Error While Running Python App on DeepStream 6.2

Hello. I am trying to run one of the deepstream python apps on a Jetson device, the model is: NVIDIA Orin NX P300 AiBox. Each time I try to run the command I come across the following Error.

==========================================
WARNING: Deserialize engine failed because file path: /opt/nvidia/deepstream/deepstream-6.2/sources/deepstream_python_apps/apps/deepstream-test1/…/…/…/…/samples/models/Primary_Detector/resnet18_trafficcamnet.etlt_b1_gpu0_int8.engine open error
0:00:03.213715947 22691 0x1f3b9160 WARN nvinfer gstnvinfer.cpp:677:gst_nvinfer_logger: NvDsInferContext[UID 1]: Warning from NvDsInferContextImpl::deserializeEngineAndBackend() <nvdsinfer_context_impl.cpp:1897> [UID = 1]: deserialize engine from file :/opt/nvidia/deepstream/deepstream-6.2/sources/deepstream_python_apps/apps/deepstream-test1/…/…/…/…/samples/models/Primary_Detector/resnet18_trafficcamnet.etlt_b1_gpu0_int8.engine failed
0:00:03.407118370 22691 0x1f3b9160 WARN nvinfer gstnvinfer.cpp:677:gst_nvinfer_logger: NvDsInferContext[UID 1]: Warning from NvDsInferContextImpl::generateBackendContext() <nvdsinfer_context_impl.cpp:2002> [UID = 1]: deserialize backend context from engine from file :/opt/nvidia/deepstream/deepstream-6.2/sources/deepstream_python_apps/apps/deepstream-test1/…/…/…/…/samples/models/Primary_Detector/resnet18_trafficcamnet.etlt_b1_gpu0_int8.engine failed, try rebuild
0:00:03.407207333 22691 0x1f3b9160 INFO nvinfer gstnvinfer.cpp:680:gst_nvinfer_logger: NvDsInferContext[UID 1]: Info from NvDsInferContextImpl::buildModel() <nvdsinfer_context_impl.cpp:1923> [UID = 1]: Trying to create engine from model files
ERROR: [TRT]: 3: [builder.cpp::~Builder::307] Error Code 3: API Usage Error (Parameter check failed at: optimizer/api/builder.cpp::~Builder::307, condition: mObjectCounter.use_count() == 1. Destroying a builder object before destroying objects it created leads to undefined behavior.
)
NvDsInferCudaEngineGetFromTltModel: Failed to open TLT encoded model file /opt/nvidia/deepstream/deepstream-6.2/sources/deepstream_python_apps/apps/deepstream-test1/…/…/…/…/samples/models/Primary_Detector/resnet18_trafficcamnet.etlt
ERROR: [TRT]: 3: [builder.cpp::~Builder::307] Error Code 3: API Usage Error (Parameter check failed at: optimizer/api/builder.cpp::~Builder::307, condition: mObjectCounter.use_count() == 1. Destroying a builder object before destroying objects it created leads to undefined behavior.
)
ERROR: Failed to create network using custom network creation function
ERROR: Failed to get cuda engine from custom library API
0:00:05.820496698 22691 0x1f3b9160 ERROR nvinfer gstnvinfer.cpp:674:gst_nvinfer_logger: NvDsInferContext[UID 1]: Error in NvDsInferContextImpl::buildModel() <nvdsinfer_context_impl.cpp:1943> [UID = 1]: build engine file failed
Segmentation fault (core dumped)

============================

• Hardware Platform (Jetson / GPU) = Jetson
• DeepStream Version = DeepStream 6.2
• JetPack Version (valid for Jetson only) = 5.1.1
• TensorRT Version = 5.1.1
• NVIDIA GPU Driver Version (valid for GPU only)

I think this is caused by the wrong version. The python bindings corresponding to DS-6.2 is v1.1.6.

It seems that you are using v1.1.10?

Please ensure that native deepstream-test1-app can run normally.

Hello @junshengy thanks for the reply, however, the pyds version I am using is 1.1.6, I installed it myself.

I just went through the error again, and I think the problem is with the engine file which is not being generated:

WARNING: Deserialize engine failed because file path: /opt/nvidia/deepstream/deepstream-6.2/sources/deepstream_python_apps/apps/deepstream-test3/…/…/…/…/samples/models/Primary_Detector/resnet18_trafficcamnet.etlt_b1_gpu0_int8.engine open error

Please is there any other suggestion on how to solve this issue?

I don’t mean the version of pyds, I mean deepstream_python_apps

git checkout v1.1.6

This model was added in DS-6.4

Thank you. While following the steps to bind deepstream python apps, I noticed that the following paths and commands may have something wrong:

cd 3rdparty/gst-python/
./autogen.sh
make
sudo make install

when I cloned the repository it creates two folders inside he folder 3rdparty which are “gstreamer and pybind11”. The folder gst-python is a subfolder insisde gstreamer and it has meson files there, I can’t see any make files there.

This is just a git issue because your submodule has cache.

git checkout v1.1.6
rm -rf 3rdparty/*
git clean -xdf
git submodule update --init

What you mean is that I don’t need to follow those steps

No, the steps in the README are correct.

The above command is just to clean up the directory and restore the initial state of the repo.

You can also delete deepstream_python_apps and then git clone again,

What I mean is that, the following steps and/file are not in the folder 3rdparty:

cd 3rdparty/gst-python/
./autogen.sh
make
sudo make install

For example, there is not such file autogen,sh, and also, instead of cd 3rdparty/gst-python it should be cd 3rdparty/gstreamer/subprojects/gst-python/. That’s how the folders a re arranged after clonning

Please follow my above command to restore your local repo first.

3rdparty/gstreamer was added in DS-6.4 and will not appear in DS-6.2.

Thank you so much for your assistance @junshengy . You’re the best.

Problem solved

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