IndexError: list index out of range problem of DashCamnet

Hello. I got the ** list index out of range** error when I do inference for DashCamnet. What’s the reason for making this error ?

  1. The model is resnet18_dashcamnet.tlt
  2. Tao Toolkit version is 4.0.1


Thank you for your help in advance.

Here is my command

sudo docker run -it --rm -v /home/ubuntu/tao_test_2023/:/workspace/tao-experiments 
                            nvcr.io/nvidia/tao/tao-toolkit:4.0.0-tf1.15.5 
                            detectnet_v2 inference 
                         -e /workspace/tao-experiments/specs_edit.txt 
                         -o /workspace/tao-experiments 
                         -i /workspace/tao-experiments/data 
                         -k tlt_encode

Here is my inference spec file

inferencer_config{  # defining target class names for the experiment.
  # Note: This must be mentioned in order of the networks classes.
  target_classes: "car"
  #target_classes: "cyclist"
  #target_classes: "pedestrian"
  # Inference dimensions.
  image_width: 1248
  image_height: 384
  # Must match what the model was trained for.
  image_channels: 3
  batch_size: 16
  gpu_index: 0
  # model handler config
  tlt_config{
   # model: "/workspace/tao-experiments/detectnet_v2/experiment_dir_retrain/weights/resnet18_detector_pruned.tlt"
     model: "/workspace/tao-experiments/resnet18_dashcamnet.tlt"
  }
}
bbox_handler_config{
  kitti_dump: true
  disable_overlay: false
  overlay_linewidth: 2
  classwise_bbox_handler_config{
    key:"car"
    value: {
      confidence_model: "aggregate_cov"
      output_map: "car"
      bbox_color{
        R: 0
        G: 255
        B: 0
      }
      clustering_config{
        clustering_algorithm: DBSCAN
        coverage_threshold: 0.005
        dbscan_eps: 0.3
        dbscan_min_samples: 0.05
        dbscan_confidence_threshold: 0.9
        minimum_bounding_box_height: 4
      }
    }
  }
}

According to DashCamNet | NVIDIA NGC, please change to 960 x 544

Could you please add more classes? From the ngc link, this model trained for car, persons, road signs and bicycles. So you can add more classwise_bbox_handler_config.

1 Like

I’ve changed the image_width and image_height to 960 and 544, and added two classes named cyclist and pedestrian.

However. I got the new error message: TypeError: unhashable type: ‘slice’

How should I do to solve this problem ?

Here is my edited inference spec file

inferencer_config{
  # defining target class names for the experiment.
  # Note: This must be mentioned in order of the networks classes.
  target_classes: "car"
  target_classes: "cyclist"
  target_classes: "pedestrian"
  # Inference dimensions.
  image_width: 960
  image_height: 544
  # Must match what the model was trained for.
  image_channels: 3
  batch_size: 16
  gpu_index: 0
  # model handler config
  tlt_config{
    #model: "/workspace/tao-experiments/detectnet_v2/experiment_dir_retrain/weights/resnet18_detector_pruned.tlt"
    model: "/workspace/tao-experiments/resnet18_dashcamnet.tlt"
  }
}
bbox_handler_config{
  kitti_dump: true
  disable_overlay: false
  overlay_linewidth: 2
  classwise_bbox_handler_config{
    key:"car"
    value: {
      confidence_model: "aggregate_cov"
      output_map: "car"
      bbox_color{
        R: 0
        G: 255
        B: 0
      }
      clustering_config{
        clustering_algorithm: DBSCAN
        coverage_threshold: 0.005
        dbscan_eps: 0.3
        dbscan_min_samples: 0.05
        dbscan_confidence_threshold: 0.9
        minimum_bounding_box_height: 4
      }
    }
  }
  classwise_bbox_handler_config{
    key:"cyclist"
    value: {
      confidence_model: "aggregate_cov"
      output_map: "cyclist"
      bbox_color{
        R: 0
        G: 255
        B: 255
      }
      clustering_config{
        clustering_algorithm: DBSCAN
        coverage_threshold: 0.005
        dbscan_eps: 0.3
        dbscan_min_samples: 0.05
        dbscan_confidence_threshold: 0.9
        minimum_bounding_box_height: 4
      }
    }
  }
  classwise_bbox_handler_config{
    key:"pedestrian"
    value: {
      confidence_model: "aggregate_cov"
      output_map: "pedestrian"
      bbox_color{
        R: 255
        G: 0
        B: 0
      }
      clustering_config{
        clustering_algorithm: DBSCAN
        coverage_threshold: 0.005
        dbscan_eps: 0.3
        dbscan_min_samples: 0.05
        dbscan_confidence_threshold: 0.9
        minimum_bounding_box_height: 4
      }
    }
  }
}

From the ngc link, this model trained for car, persons, road signs and bicycles. Please change.

It works after I changed the targets according to your suggestions.

Thank you very much !

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.