Custom YoloV4 error on Jetson

Please provide complete information as applicable to your setup.

• Hardware Platform (Jetson / GPU) Jetson AGX Xavier
• DeepStream Version 5.0
• JetPack Version (valid for Jetson only) 4.5
• TensorRT Version 7.1.3.0
• Issue Type( questions, new requirements, bugs) Error
**• How to reproduce the issue ? **
Hello

I have a problem with my custom yoloV4 model on jetson
I have followed two manuals that I have found
https://github.com/NVIDIA-AI-IOT/yolov4_deepstream

And the one that appears in the FAQ
https://forums.developer.nvidia.com/t/deepstream-sdk-faq/80236

Using the first one I have managed to work correctly on a laptop with deepstream 5.0 and a QUADRO RTX4000 graphics card.

I have made the conversion of the YoloV4 → ONNX → TensorRt model on the laptop, it would be necessary to make the conversion on the Jetson

But when I try to start it on the nvidia Jetson I get this error:

ERROR: [TRT]: coreReadArchive.cpp (38) - Serialization Error in verifyHeader: 0 (Version tag does not match)
ERROR: [TRT]: INVALID_STATE: std::exception
ERROR: [TRT]: INVALID_CONFIG: Deserialize the cuda engine failed.
ERROR: Deserialize engine failed from file: /opt/nvidia/deepstream/deepstream-5.0/configs/yoloV4_CUSTOM/yolov4_1_3_416_416_fp16.engine
0:00:01.692718400 10014      0x49486c0 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.9/configs/yoloV4_CUSTOM/yolov4_1_3_416_416_fp16.engine failed
0:00:01.692792160 10014      0x49486c0 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/configs/yoloV4_CUSTOM/yolov4_1_3_416_416_fp16.engine failed, try rebuild
0:00:01.692819360 10014      0x49486c0 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: Failed to create network using custom network creation function
ERROR: Failed to get cuda engine from custom library API
0:00:01.693143616 10014      0x49486c0 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:01.693248896 10014      0x49486c0 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:01.693298688 10014      0x49486c0 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:01.693642976 10014      0x49486c0 WARN                 nvinfer gstnvinfer.cpp:809:gst_nvinfer_start:<primary_gie> error: Failed to create NvDsInferContext instance
0:00:01.693668288 10014      0x49486c0 WARN                 nvinfer gstnvinfer.cpp:809:gst_nvinfer_start:<primary_gie> error: Config file path: /opt/nvidia/deepstream/deepstream-5.0/configs/yoloV4_CUSTOM/config_infer_primary_yoloV4.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: /dvs/git/dirty/git-master_linux/deepstream/sdk/src/gst-plugins/gst-nvinfer/gstnvinfer.cpp(809): gst_nvinfer_start (): /GstPipeline:pipeline/GstBin:primary_gie_bin/GstNvInfer:primary_gie:
Config file path: /opt/nvidia/deepstream/deepstream-5.0/configs/yoloV4_CUSTOM/config_infer_primary_yoloV4.txt, NvDsInfer Error: NVDSINFER_CONFIG_FAILED
App run failed

Many thanks!!

Hi,

Please noted that TensorRT engine doesn’t support portability.
So you will need to create the engine file directly on the Jetson platform.

Thanks.

It has worked!

Many thanks!