# Running YOLOV4 on DS 5.0

**URL:** <https://forums.developer.nvidia.com/t/running-yolov4-on-ds-5-0/172745>\
**Category:** DeepStream SDK\
**Tags:** python\
**Created:** [March 18, 2021, 2:59pm UTC](https://forums.developer.nvidia.com/t/running-yolov4-on-ds-5-0/172745 "2021-03-18T14:59:19Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![xya22er](https://developer.download.nvidia.com/images/forums/profile-default-devtalk-84.png) [@xya22er](https://forums.developer.nvidia.com/u/xya22er)\
**Post date:** [March 18, 2021, 2:59pm UTC](https://forums.developer.nvidia.com/t/running-yolov4-on-ds-5-0/172745/1 "2021-03-18T14:59:19Z")

</div>

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](https://forums.developer.nvidia.com/t/get-wrong-infer-results-while-testing-yolov4-on-deepstream-5-0/125526/12)

But I get this error

```auto
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:

```auto
[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**

---

<div class="post-metadata">

**Author:** ![mchi](https://sea2.discourse-cdn.com/nvidia/user_avatar/forums.developer.nvidia.com/mchi/32/14043_2.png) [@mchi](https://forums.developer.nvidia.com/u/mchi)\
**Post date:** [March 21, 2021, 1:24pm UTC](https://forums.developer.nvidia.com/t/running-yolov4-on-ds-5-0/172745/3 "2021-03-21T13:24:26Z")

</div>

Could you share a repo?  
And, why don’t use C++ YoloV4: [GitHub - NVIDIA-AI-IOT/yolov4\_deepstream](https://github.com/NVIDIA-AI-IOT/yolov4_deepstream)?

---

<div class="post-metadata">

**Author:** ![xya22er](https://developer.download.nvidia.com/images/forums/profile-default-devtalk-84.png) [@xya22er](https://forums.developer.nvidia.com/u/xya22er)\
**Post date:** [March 21, 2021, 6:17pm UTC](https://forums.developer.nvidia.com/t/running-yolov4-on-ds-5-0/172745/4 "2021-03-21T18:17:03Z")

</div>

I think the problem was in onnx model  
I was follow this tutorial [tensorrt\_demos](https://github.com/jkjung-avt/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](https://github.com/Tianxiaomo/pytorch-YOLOv4) in section 3 (Darknet2ONNX), I converted the model to onnx after that I used trtexec to build engine.  
It work fine on deepstream

---

<div class="post-metadata">

**Author:** ![TomNVIDIA](https://sea2.discourse-cdn.com/nvidia/user_avatar/forums.developer.nvidia.com/tomnvidia/32/14181_2.png) [@TomNVIDIA](https://forums.developer.nvidia.com/u/TomNVIDIA)\
**Post date:** [October 12, 2021, 4:14pm UTC](https://forums.developer.nvidia.com/t/running-yolov4-on-ds-5-0/172745/6 "2021-10-12T16:14:52Z")

</div>


