TLT Detecnet_v2 Inference Error

Hi,

I have trained Detectnet_v2 (resnet 18 backbone) with FLIR Images Dataset (Thermal Images). In part 8. Visualize Inferences, I got “ValueError: axes don’t match array”.

=> Here is the Part 8 code :

#Running inference for detection on n images
!tlt-infer detectnet_v2 -e $SPECS_DIR/detectnet_v2_inference_kitti_tlt.txt
-o $USER_EXPERIMENT_DIR/tlt_infer_testing
-i $DATA_DOWNLOAD_DIR/testing/image_2
-k $KEY

=> Here is the full output:

Using TensorFlow backend.
2020-10-06 07:25:32,522 [INFO] iva.detectnet_v2.scripts.inference: Overlain images will be saved in the output path.
2020-10-06 07:25:32,522 [INFO] iva.detectnet_v2.inferencer.build_inferencer: Constructing inferencer
2020-10-06 07:25:33,057 [INFO] iva.detectnet_v2.inferencer.tlt_inferencer: Loading model from /workspace/tlt-experiments/detectnet_v2/experiment_dir_retrain/weights/resnet18_detector_pruned.tlt:


Layer (type) Output Shape Param #

input_1 (InputLayer) (None, 3, 512, 640) 0


model_1 (Model) [(None, 4, 32, 40), (None 2822028

Total params: 2,822,028
Trainable params: 2,815,020
Non-trainable params: 7,008


2020-10-06 07:25:36,191 [INFO] iva.detectnet_v2.scripts.inference: Initialized model
2020-10-06 07:25:36,192 [INFO] iva.detectnet_v2.scripts.inference: Commencing inference
0%| | 0/13 [00:00<?, ?it/s]
Traceback (most recent call last):
File “/usr/local/bin/tlt-infer”, line 8, in
sys.exit(main())
File “./common/magnet_infer.py”, line 56, in main
File “./detectnet_v2/scripts/inference.py”, line 194, in main
File “./detectnet_v2/scripts/inference.py”, line 150, in inference_wrapper_batch
File “./detectnet_v2/inferencer/tlt_inferencer.py”, line 139, in infer_batch
File “./detectnet_v2/inferencer/base_inferencer.py”, line 112, in input_preprocessing
ValueError: axes don’t match array

=> And, here is the detectnet_v2_inference_kitti_tlt.txt script:
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: “bicycle”
target_classes: “dog”
target_classes: “person”

#Inference dimensions.
image_width: 640
image_height: 512
#Must match what the model was trained for.
image_channels: 3
batch_size: 8
gpu_index: 0
#model handler config
tlt_config{
model: “/workspace/tlt-experiments/detectnet_v2/experiment_dir_retrain/weights/resnet18_detector_pruned.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”
confidence_threshold: 0.9
bbox_color{
R: 0
G: 255
B: 0
}
clustering_config{
coverage_threshold: 0.00
dbscan_eps: 0.3
dbscan_min_samples: 0.05
minimum_bounding_box_height: 1
}
}
}
classwise_bbox_handler_config{
key:“bicycle”
value: {
confidence_model: “aggregate_cov”
output_map: “bicycle”
confidence_threshold: 0.9
bbox_color{
R: 0
G: 255
B: 255
}
clustering_config{
coverage_threshold: 0.00
dbscan_eps: 0.3
dbscan_min_samples: 0.05
minimum_bounding_box_height: 1
}
}
}
classwise_bbox_handler_config{
key:“dog”
value: {
confidence_model: “aggregate_cov”
output_map: “dog”
confidence_threshold: 0.9
bbox_color{
R: 255
G: 0
B: 0
}
clustering_config{
coverage_threshold: 0.00
dbscan_eps: 0.3
dbscan_min_samples: 0.05
minimum_bounding_box_height: 1
}
}
}
classwise_bbox_handler_config{
key:“person”
value: {
confidence_model: “aggregate_cov”
output_map: “person”
confidence_threshold: 0.9
bbox_color{
R: 0
G: 0
B: 255
}
clustering_config{
coverage_threshold: 0.00
dbscan_eps: 0.3
dbscan_min_samples: 0.05
minimum_bounding_box_height: 1
}
}
}
}

Could you please help me about this issue bz i couldnt catch the point why is this happened?

Thanks :)

Reference: ValueError: axes don't match array - #5 by kayccc