Num classes mismatch

[property]
gpu-id=0
net-scale-factor=0.0039215697906911373
model-color-format=0
#model-engine-file=model_b1_gpu0_fp16.engine
model-file=my_yolov4.weights
custom-network-config=my_yolov4.cfg
labelfile-path=safekerala_labels.txt
batch-size=1
network-mode=2
num-detected-classes=19
interval=0
gie-unique-id=1
process-mode=1
cluster-mode=2
maintain-aspect-ratio=1
#parse-bbox-func-name=NvDsInferCreateModelParser
#custom-lib-path=1.so
#engine-create-func-name=NvDsInferCudaEngineGet
parse-bbox-func-name=NvDsInferParseYolo
custom-lib-path=car_detector_june_8_new.so
engine-create-func-name=NvDsInferYoloCudaEngineGet

[class-attrs-all]
nms-iou-threshold=0.45
pre-cluster-threshold=0.25

I have a three detector pipeline. for the first detector, I’ using the above config file. problem is, when the pipeline converts the model to .engine by itself (and saves the .engine file), the pipeline runs fine.
but next to save time, I comment below two lines,
#model-file=my_yolov4.weights
#custom-network-config=my_yolov4.cfg
and un-comment the below line,
model-engine-file=model_b1_gpu0_fp32.engine

I get num classes mismatch error. even when the pipeline ran with the same .engine model.

what can I be doing wrong here ?

Hi,

Have you updated the output class number for your model?
There are some parameters in the YOLO parser that need to be configured as well.

You can find a document for YOLO customization below:

https://docs.nvidia.com/metropolis/deepstream/dev-guide/text/DS_custom_YOLO.html

Thanks.

Yes, tried that. but now gives seg-fault.
changing NUM_CLASSES_YOLO in nvdsinfer_custom_impl_Yolo/nvdsparsebbox_Yolo.cpp, updating the config file to read this newly created .so file.
these are the only changes.
also, Im using DS6.0. and YoloV4Tiny

Hi,

For YOLOv4, please find the specific guide below:

Although it is tested by Deepstream 5, it should work on the newer Deepstream with the similar changes.

Thanks.

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