Running YOLOV4 on DS 5.0

I follow this to can use yolov4 in DS 5.0

https://forums.developer.nvidia.com/t/get-wrong-infer-results-while-testing-yolov4-on-deepstream-5-0/125526/12?u=yasser.rh

But I get this error

python: nvdsparsebbox_Yolo.cpp:524: bool
NvDsInferParseCustomYoloV4(const std::vector<NvDsInferLayerInfo>&, const
NvDsInferNetworkInfo&, const NvDsInferParseDetectionParams&,
std::vector<NvDsInferObjectDetectionInfo>&): 
Assertion `scores.inferDims.numDims == 2' failed

config file:

[property]
gpu-id=0
net-scale-factor=0.0039215697906911373


#onnx-file=/home/jetson-nx/codes/models/yolo-1-person/yolov4-768.onnx
model-engine-file=/home/jetson-nx/codes/models/yolo-1-person/yolov4-768.plan
labelfile-path=/home/jetson-nx/codes/models/yolo-1-person/labels.txt

force-implicit-batch-dim=1
batch-size=1
process-mode=1
model-color-format=0
network-mode=1
num-detected-classes=1
interval=0
gie-unique-id=1
maintain-aspect-ratio=1
cluster-mode=2
parse-bbox-func-name=NvDsInferParseCustomYoloV4
custom-lib-path=/opt/nvidia/deepstream/deepstream-5.0/sources/objectDetector_Yolo/nvdsinfer_custom_impl_Yolo/libnvdsinfer_custom_impl_Yolo.so
engine-create-func-name=NvDsInferYoloCudaEngineGet
[class-attrs-all]
pre-cluster-threshold=0.2
eps=0.2
group-threshold=1

• Hardware Platform: NX
• DeepStream 5.0

Could you share a repo?
And, why don’t use C++ YoloV4: GitHub - NVIDIA-AI-IOT/yolov4_deepstream?

I think the problem was in onnx model
I was follow this tutorial tensorrt_demos to convert yolov4 model to onnx and I used trtexec to convert onnx to tensorrt model. It gave this problem.
But, I found another way to convert yolov4 model to onnx:
in this repo in section 3 (Darknet2ONNX), I converted the model to onnx after that I used trtexec to build engine.
It work fine on deepstream

1 Like