I just trained a yolov4 model on the TAO Toolkit, then referenced the ‘.etlt’, calibration and labels file in my Deepstream python application. The application failed to create model engine file. I was able to run a ‘detectnet_v2’ resnet18 model on the same deepstream application without any issues. Can anyone point out the cause of the issue?
Xavier supports INT8 inference.
So the etlt model can work with the same configuration, but the exported INT8 model and the corresponding calibration file cannot work with the above config? Can you provide the log of the issue?
Also, I have a question on your jetpack&deepstream version. Jetpack4.6 should work together with DeepStream6.0, and deepstream5.1 corresponds to Jetpack4.5.1, your version seems to be mixed. Please consider upgrading to the latest version of Jetpack and DeepStream.
The ‘.etlt’ model doesn’t work without the INT8 configuration file. If there is a way to do that, kindly let me know.
Here is the console output.
The output folder frames already exists. Removing...
Frames will be saved in frames
Creating Pipeline
Creating streamux
Creating source_bin 0
Creating source bin
source-bin-00
Creating Pgie
Creating nvvidconv1
Creating filter1
Creating tiler
Creating nvvidconv
Creating nvosd
Creating transform
Creating EGLSink
Atleast one of the sources is live
Warn: 'threshold' parameter has been deprecated. Use 'pre-cluster-threshold' instead.
Adding elements to Pipeline
Linking elements in the Pipeline
Now playing...
1 : rtsp://admin:abc12345@10.50.15.182
Starting pipeline
Using winsys: x11
gstnvtracker: Loading low-level lib at /opt/nvidia/deepstream/deepstream-5.1/lib/libnvds_mot_klt.so
gstnvtracker: Optional NvMOT_RemoveStreams not implemented
gstnvtracker: Batch processing is OFF
gstnvtracker: Past frame output is OFF
0:00:00.308914840 15475 0x2db33840 INFO nvinfer gstnvinfer.cpp:619:gst_nvinfer_logger:<primary-inference> NvDsInferContext[UID 1]: Info from NvDsInferContextImpl::buildModel() <nvdsinfer_context_impl.cpp:1716> [UID = 1]: Trying to create engine from model files
ERROR: [TRT]: UffParser: Could not read buffer.
parseModel: Failed to parse UFF model
ERROR: failed to build network since parsing model errors.
ERROR: Failed to create network using custom network creation function
ERROR: Failed to get cuda engine from custom library API
0:00:01.849316101 15475 0x2db33840 ERROR nvinfer gstnvinfer.cpp:613:gst_nvinfer_logger:<primary-inference> NvDsInferContext[UID 1]: Error in NvDsInferContextImpl::buildModel() <nvdsinfer_context_impl.cpp:1736> [UID = 1]: build engine file failed
Segmentation fault (core dumped)
Also, I don’t think the there is a Deepstream-Jetpack version conflict since I was able to train a ‘detectnet_v2’ resnet18 model on the TAO Toolkit and run it on the same deepstream application without any issues.
I just checked and the ‘!tao yolo_v4 inference’ cell in the training notebook ran without any problems. The predictions were clearly visible in the images inside the ‘yolo_infer_images’ folder.
According to your suggestion here, I installed Deepstream 6.0 and tried to run my yolov4 model in one of the applications. The engine file was successfully created by the sample application. But, the application stops at the first frame due to a bounding box parsing error.
Here is the console output.
Frames will be saved in frames
Creating Pipeline
Creating streamux
Creating source_bin 0
Creating source bin
source-bin-00
Creating Pgie
Creating nvvidconv1
Creating filter1
Creating tiler
Creating nvvidconv
Creating nvosd
Creating transform
Creating EGLSink
Atleast one of the sources is live
Warn: 'threshold' parameter has been deprecated. Use 'pre-cluster-threshold' instead.
Adding elements to Pipeline
Linking elements in the Pipeline
Now playing...
1 : rtsp://admin:abc12345@10.50.15.182
Starting pipeline
Using winsys: x11
0:00:03.788714178 9630 0x6321d00 INFO nvinfer gstnvinfer.cpp:638:gst_nvinfer_logger:<primary-inference> NvDsInferContext[UID 1]: Info from NvDsInferContextImpl::deserializeEngineAndBackend() <nvdsinfer_context_impl.cpp:1900> [UID = 1]: deserialized trt engine from :/opt/nvidia/deepstream/deepstream-6.0/sources/deepstream_python_apps/apps/deepstream-imagedata-multistream-edit/tao/tlt_files_lums_engine/yolov4_resnet18_epoch_005.etlt_b1_gpu0_int8.engine
INFO: [Implicit Engine Info]: layers num: 5
0 INPUT kFLOAT Input 3x384x1248
1 OUTPUT kINT32 BatchedNMS 1
2 OUTPUT kFLOAT BatchedNMS_1 200x4
3 OUTPUT kFLOAT BatchedNMS_2 200
4 OUTPUT kFLOAT BatchedNMS_3 200
ERROR: [TRT]: 3: Cannot find binding of given name: boxes
0:00:03.789028661 9630 0x6321d00 WARN nvinfer gstnvinfer.cpp:635:gst_nvinfer_logger:<primary-inference> NvDsInferContext[UID 1]: Warning from NvDsInferContextImpl::checkBackendParams() <nvdsinfer_context_impl.cpp:1868> [UID = 1]: Could not find output layer 'boxes' in engine
ERROR: [TRT]: 3: Cannot find binding of given name: scores
0:00:03.789153500 9630 0x6321d00 WARN nvinfer gstnvinfer.cpp:635:gst_nvinfer_logger:<primary-inference> NvDsInferContext[UID 1]: Warning from NvDsInferContextImpl::checkBackendParams() <nvdsinfer_context_impl.cpp:1868> [UID = 1]: Could not find output layer 'scores' in engine
ERROR: [TRT]: 3: Cannot find binding of given name: classes
0:00:03.789343880 9630 0x6321d00 WARN nvinfer gstnvinfer.cpp:635:gst_nvinfer_logger:<primary-inference> NvDsInferContext[UID 1]: Warning from NvDsInferContextImpl::checkBackendParams() <nvdsinfer_context_impl.cpp:1868> [UID = 1]: Could not find output layer 'classes' in engine
0:00:03.789476752 9630 0x6321d00 INFO nvinfer gstnvinfer.cpp:638:gst_nvinfer_logger:<primary-inference> NvDsInferContext[UID 1]: Info from NvDsInferContextImpl::generateBackendContext() <nvdsinfer_context_impl.cpp:2004> [UID = 1]: Use deserialized engine model: /opt/nvidia/deepstream/deepstream-6.0/sources/deepstream_python_apps/apps/deepstream-imagedata-multistream-edit/tao/tlt_files_lums_engine/yolov4_resnet18_epoch_005.etlt_b1_gpu0_int8.engine
0:00:03.811989524 9630 0x6321d00 INFO nvinfer gstnvinfer_impl.cpp:313:notifyLoadModelStatus:<primary-inference> [UID 1]: Load new model:dstest_imagedata_config.txt sucessfully
Decodebin child added: source
Decodebin child added: decodebin0
Decodebin child added: rtppcmadepay0
Decodebin child added: alawdec0
In cb_newpad
**PERF: {'stream0': 0.0}
Decodebin child added: decodebin1
Decodebin child added: rtph264depay0
Decodebin child added: h264parse0
Decodebin child added: capsfilter0
Decodebin child added: nvv4l2decoder0
Opening in BLOCKING MODE
NvMMLiteOpen : Block : BlockType = 261
NVMEDIA: Reading vendor.tegra.display-size : status: 6
NvMMLiteBlockCreate : Block : BlockType = 261
In cb_newpad
0:00:06.539014075 9630 0x63178a0 ERROR nvinfer gstnvinfer.cpp:632:gst_nvinfer_logger:<primary-inference> NvDsInferContext[UID 1]: Error in NvDsInferContextImpl::parseBoundingBox() <nvdsinfer_context_impl_output_parsing.cpp:59> [UID = 1]: Could not find output coverage layer for parsing objects
0:00:06.539097664 9630 0x63178a0 ERROR nvinfer gstnvinfer.cpp:632:gst_nvinfer_logger:<primary-inference> NvDsInferContext[UID 1]: Error in NvDsInferContextImpl::fillDetectionOutput() <nvdsinfer_context_impl_output_parsing.cpp:735> [UID = 1]: Failed to parse bboxes
Segmentation fault (core dumped)