Unable to run Deepstream on a YoloV3 ONNX model

Please provide complete information as applicable to your setup.

• Hardware Platform (Jetson / GPU) GPU
• DeepStream Version 5.1
• JetPack Version (valid for Jetson only)
• TensorRT Version 7.0
• NVIDIA GPU Driver Version (valid for GPU only) 10.2
• Issue Type( questions, new requirements, bugs) bugs
• How to reproduce the issue ? (This is for bugs. Including which sample app is using, the configuration files content, the command line used and other details for reproducing)
• Requirement details( This is for new requirement. Including the module name-for which plugin or for which sample application, the function description)

I am trying to deploy a yolov3 model to deepstream sdk using the following config file:
config_yolov3_onnx.txt (4.6 KB)

I get the following error :

0:00:00.306201428 846652 0x558b39cd5060 WARN                 nvinfer gstnvinfer.cpp:616:gst_nvinfer_logger:<primary_gie> NvDsInferContext[UID 1]: Warning from NvDsInferContextImpl::deserializeEngineAndBackend() <nvdsinfer_context_impl.cpp:1690> [UID = 1]: deserialize engine from file :/opt/nvidia/deepstream/deepstream-5.0/samples/configs/deepstream-app/../../models/Fire_Model/yolov3_onnx.engine failed
0:00:00.306220406 846652 0x558b39cd5060 WARN                 nvinfer gstnvinfer.cpp:616:gst_nvinfer_logger:<primary_gie> NvDsInferContext[UID 1]: Warning from NvDsInferContextImpl::generateBackendContext() <nvdsinfer_context_impl.cpp:1797> [UID = 1]: deserialize backend context from engine from file :/opt/nvidia/deepstream/deepstream-5.0/samples/configs/deepstream-app/../../models/Fire_Model/yolov3_onnx.engine failed, try rebuild
0:00:00.306227613 846652 0x558b39cd5060 INFO                 nvinfer gstnvinfer.cpp:619:gst_nvinfer_logger:<primary_gie> NvDsInferContext[UID 1]: Info from NvDsInferContextImpl::buildModel() <nvdsinfer_context_impl.cpp:1715> [UID = 1]: Trying to create engine from model files
Yolo type is not defined from config file name:
ERROR: ../nvdsinfer/nvdsinfer_model_builder.cpp:797 Failed to create network using custom network creation function
ERROR: ../nvdsinfer/nvdsinfer_model_builder.cpp:862 Failed to get cuda engine from custom library API
0:00:00.306353600 846652 0x558b39cd5060 ERROR                nvinfer gstnvinfer.cpp:613:gst_nvinfer_logger:<primary_gie> NvDsInferContext[UID 1]: Error in NvDsInferContextImpl::buildModel() <nvdsinfer_context_impl.cpp:1735> [UID = 1]: build engine file failed
0:00:00.306361953 846652 0x558b39cd5060 ERROR                nvinfer gstnvinfer.cpp:613:gst_nvinfer_logger:<primary_gie> NvDsInferContext[UID 1]: Error in NvDsInferContextImpl::generateBackendContext() <nvdsinfer_context_impl.cpp:1821> [UID = 1]: build backend context failed
0:00:00.306367822 846652 0x558b39cd5060 ERROR                nvinfer gstnvinfer.cpp:613:gst_nvinfer_logger:<primary_gie> NvDsInferContext[UID 1]: Error in NvDsInferContextImpl::initialize() <nvdsinfer_context_impl.cpp:1148> [UID = 1]: generate backend failed, check config file settings
0:00:00.306387467 846652 0x558b39cd5060 WARN                 nvinfer gstnvinfer.cpp:809:gst_nvinfer_start:<primary_gie> error: Failed to create NvDsInferContext instance
0:00:00.306391830 846652 0x558b39cd5060 WARN                 nvinfer gstnvinfer.cpp:809:gst_nvinfer_start:<primary_gie> error: Config file path: /opt/nvidia/deepstream/deepstream-5.0/samples/configs/deepstream-app/config_fire_infer.txt, NvDsInfer Error: NVDSINFER_CONFIG_FAILED
** ERROR: <main:655>: Failed to set pipeline to PAUSED
Quitting
ERROR from primary_gie: Failed to create NvDsInferContext instance
Debug info: gstnvinfer.cpp(809): gst_nvinfer_start (): /GstPipeline:pipeline/GstBin:primary_gie_bin/GstNvInfer:primary_gie:
Config file path: /opt/nvidia/deepstream/deepstream-5.0/samples/configs/deepstream-app/config_fire_infer.txt, NvDsInfer Error: NVDSINFER_CONFIG_FAILED
App run failed

Any help is appreciated.

where is your yolov3 model from? is it onnx file?
If it’s not from darknet (*.cfg) file, you can’t use the custom yolov3 TRT engine func - NvDsInferYoloCudaEngineGet as you specified in the config.

engine-create-func-name=NvDsInferYoloCudaEngineGet

@mchi , yes my model is a onnx file which I have generated using tf2onnx from a saved YOLOV3 .h5 file. Regarding the bbox-parser and engine-create-func-name, what should I use in place of the default yolo functions

Hi @tathagatd96 ,
Sorry for delay!

Since it’s ONNX model, you can use default engine build fuction, you can refer to config_infer_primary_yoloV4.txt under yolov4_deepstream/deepstream_yolov4 at master · NVIDIA-AI-IOT/yolov4_deepstream · GitHub ,

and, for post-processor, it depends on what the output of your model is, you can also refer to this yolov4 sample to add your own post-processor

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