# Deepstream Python Error

**URL:** <https://forums.developer.nvidia.com/t/deepstream-python-error/144755>\
**Category:** DeepStream SDK\
**Created:** [July 30, 2020, 12:59pm UTC](https://forums.developer.nvidia.com/t/deepstream-python-error/144755 "2020-07-30T12:59:31Z")\
**Posts on this page:** 11\
**Page:** 1

<div class="post-metadata">

**Author:** ![airpixin](https://developer.download.nvidia.com/images/forums/profile-default-devtalk-84.png) [@airpixin](https://forums.developer.nvidia.com/u/airpixin)\
**Post date:** [July 30, 2020, 12:59pm UTC](https://forums.developer.nvidia.com/t/deepstream-python-error/144755/1 "2020-07-30T12:59:31Z")

</div>

**Hardware Platform:** [AGX Xavier™ Developer Kit]  
**Software Version:** [Jetpack 4.4]  
Deepstream 5.0

I am getting this error while running Python Deepstream test code  
The Sample codes installed works ( deepstream-app -c config | works )

xxxx@xxxx-desktop:/opt/nvidia/deepstream/deepstream-5.0/sources/python/apps/deepstream-test1$ python3 deepstream\_test\_1.py …/…/…/…/samples/streams/sample\_720p.mp4

Creating Pipeline

Creating Source

Creating H264Parser

Creating Decoder

Creating EGLSink

Playing file …/…/…/…/samples/streams/sample\_720p.mp4  
Warn: ‘threshold’ parameter has been deprecated. Use ‘pre-cluster-threshold’ instead.  
Adding elements to Pipeline

Linking elements in the Pipeline

Starting pipeline

Using winsys: x11  
Opening in BLOCKING MODE  
ERROR: Deserialize engine failed because file path: /opt/nvidia/deepstream/deepstream-5.0/sources/python/apps/deepstream-test1/opt/nvidia/deepstream/deepstream-5.0/samples/models/Primary\_Detector/resnet10.caffemodel\_b1\_gpu0\_int8.engine open error  
0:00:01.436452314 30834 0x341ea190 WARN nvinfer gstnvinfer.cpp:599:gst\_nvinfer\_logger: NvDsInferContext[UID 1]: Warning from NvDsInferContextImpl::deserializeEngineAndBackend() \<nvdsinfer\_context\_impl.cpp:1566\> [UID = 1]: deserialize engine from file :/opt/nvidia/deepstream/deepstream-5.0/sources/python/apps/deepstream-test1/opt/nvidia/deepstream/deepstream-5.0/samples/models/Primary\_Detector/resnet10.caffemodel\_b1\_gpu0\_int8.engine failed  
0:00:01.436692901 30834 0x341ea190 WARN nvinfer gstnvinfer.cpp:599:gst\_nvinfer\_logger: NvDsInferContext[UID 1]: Warning from NvDsInferContextImpl::generateBackendContext() \<nvdsinfer\_context\_impl.cpp:1673\> [UID = 1]: deserialize backend context from engine from file :/opt/nvidia/deepstream/deepstream-5.0/sources/python/apps/deepstream-test1/opt/nvidia/deepstream/deepstream-5.0/samples/models/Primary\_Detector/resnet10.caffemodel\_b1\_gpu0\_int8.engine failed, try rebuild  
0:00:01.436883821 30834 0x341ea190 INFO nvinfer gstnvinfer.cpp:602:gst\_nvinfer\_logger: NvDsInferContext[UID 1]: Info from NvDsInferContextImpl::buildModel() \<nvdsinfer\_context\_impl.cpp:1591\> [UID = 1]: Trying to create engine from model files  
ERROR: Cannot access caffemodel file ‘/opt/nvidia/deepstream/deepstream-5.0/sources/python/apps/deepstream-test1/opt/nvidia/deepstream/deepstream-5.0/samples/models/Primary\_Detector/resnet10.caffemodel’  
ERROR: failed to build network since parsing model errors.  
ERROR: failed to build network.  
0:00:01.437789173 30834 0x341ea190 ERROR nvinfer gstnvinfer.cpp:596:gst\_nvinfer\_logger: NvDsInferContext[UID 1]: Error in NvDsInferContextImpl::buildModel() \<nvdsinfer\_context\_impl.cpp:1611\> [UID = 1]: build engine file failed  
0:00:01.437844728 30834 0x341ea190 ERROR nvinfer gstnvinfer.cpp:596:gst\_nvinfer\_logger: NvDsInferContext[UID 1]: Error in NvDsInferContextImpl::generateBackendContext() \<nvdsinfer\_context\_impl.cpp:1697\> [UID = 1]: build backend context failed  
0:00:01.437876025 30834 0x341ea190 ERROR nvinfer gstnvinfer.cpp:596:gst\_nvinfer\_logger: NvDsInferContext[UID 1]: Error in NvDsInferContextImpl::initialize() \<nvdsinfer\_context\_impl.cpp:1024\> [UID = 1]: generate backend failed, check config file settings  
0:00:01.437926108 30834 0x341ea190 WARN nvinfer gstnvinfer.cpp:781:gst\_nvinfer\_start: error: Failed to create NvDsInferContext instance  
0:00:01.437951517 30834 0x341ea190 WARN nvinfer gstnvinfer.cpp:781:gst\_nvinfer\_start: error: Config file path: dstest1\_pgie\_config.txt, NvDsInfer Error: NVDSINFER\_CONFIG\_FAILED  
Error: gst-resource-error-quark: Failed to create NvDsInferContext instance (1): /dvs/git/dirty/git-master\_linux/deepstream/sdk/src/gst-plugins/gst-nvinfer/gstnvinfer.cpp(781): gst\_nvinfer\_start (): /GstPipeline:pipeline0/GstNvInfer:primary-inference:  
Config file path: dstest1\_pgie\_config.txt, NvDsInfer Error: NVDSINFER\_CONFIG\_FAILED

---

<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:** [July 31, 2020, 5:30am UTC](https://forums.developer.nvidia.com/t/deepstream-python-error/144755/3 "2020-07-31T05:30:30Z")

</div>

hI @airpixin,  
Try adding “force-implicit-batch-dim=1” as below.  
But, the offically DeepStream for Jetpack4.4 is DeepStream5.0GA which is coming very soon.

[property]  
gpu-id=0  
net-scale-factor=0.0039215697906911373  
model-file=…/…/…/…/samples/models/Primary\_Detector/resnet10.caffemodel  
proto-file=…/…/…/…/samples/models/Primary\_Detector/resnet10.prototxt  
model-engine-file=…/…/…/…/samples/models/Primary\_Detector/resnet10.caffemodel\_b1\_gpu0\_int8.engine  
labelfile-path=…/…/…/…/samples/models/Primary\_Detector/labels.txt  
int8-calib-file=…/…/…/…/samples/models/Primary\_Detector/cal\_trt.bin  
**force-implicit-batch-dim=1**  
batch-size=1  
network-mode=1  
num-detected-classes=4  
interval=0  
gie-unique-id=1  
output-blob-names=conv2d\_bbox;conv2d\_cov/Sigmoid

---

<div class="post-metadata">

**Author:** ![airpixin](https://developer.download.nvidia.com/images/forums/profile-default-devtalk-84.png) [@airpixin](https://forums.developer.nvidia.com/u/airpixin)\
**Post date:** [August 1, 2020, 7:09am UTC](https://forums.developer.nvidia.com/t/deepstream-python-error/144755/4 "2020-08-01T07:09:22Z")

</div>

Thanks ,  
I tried what you asked for.  
There is no error now. But the execution is stuck at

**NvMMLiteBlockCreate : Block : BlockType = 261**

xxxx@xxxx-desktop:/opt/nvidia/deepstream/deepstream-5.0/sources/python/apps/deepstream-test1$ python3 deepstream\_test\_1.py …/…/…/…/samples/streams/sample\_720p.mp4  
Creating Pipeline

Creating Source

Creating H264Parser

Creating Decoder

Creating EGLSink

Playing file …/…/…/…/samples/streams/sample\_720p.mp4  
Warn: ‘threshold’ parameter has been deprecated. Use ‘pre-cluster-threshold’ instead.  
Adding elements to Pipeline

Linking elements in the Pipeline

Starting pipeline

Using winsys: x11  
Opening in BLOCKING MODE  
0:00:03.100719469 10327 0x3aecab90 INFO nvinfer gstnvinfer.cpp:602:gst\_nvinfer\_logger: NvDsInferContext[UID 1]: Info from NvDsInferContextImpl::deserializeEngineAndBackend() \<nvdsinfer\_context\_impl.cpp:1577\> [UID = 1]: deserialized trt engine from :/opt/nvidia/deepstream/deepstream-5.0/samples/models/Primary\_Detector/resnet10.caffemodel\_b1\_gpu0\_int8.engine  
INFO: [Implicit Engine Info]: layers num: 3  
0 INPUT kFLOAT input\_1 3x368x640  
1 OUTPUT kFLOAT conv2d\_bbox 16x23x40  
2 OUTPUT kFLOAT conv2d\_cov/Sigmoid 4x23x40

0:00:03.101016568 10327 0x3aecab90 INFO nvinfer gstnvinfer.cpp:602:gst\_nvinfer\_logger: NvDsInferContext[UID 1]: Info from NvDsInferContextImpl::generateBackendContext() \<nvdsinfer\_context\_impl.cpp:1681\> [UID = 1]: Use deserialized engine model: /opt/nvidia/deepstream/deepstream-5.0/samples/models/Primary\_Detector/resnet10.caffemodel\_b1\_gpu0\_int8.engine  
0:00:03.105303358 10327 0x3aecab90 INFO nvinfer gstnvinfer\_impl.cpp:311:notifyLoadModelStatus: [UID 1]: Load new model:dstest1\_pgie\_config.txt sucessfully  
NvMMLiteOpen : Block : BlockType = 261  
NVMEDIA: Reading vendor.tegra.display-size : status: 6  
NvMMLiteBlockCreate : Block : BlockType = 261

---

<div class="post-metadata">

**Author:** ![airpixin](https://developer.download.nvidia.com/images/forums/profile-default-devtalk-84.png) [@airpixin](https://forums.developer.nvidia.com/u/airpixin)\
**Post date:** [August 1, 2020, 7:20am UTC](https://forums.developer.nvidia.com/t/deepstream-python-error/144755/5 "2020-08-01T07:20:02Z")

</div>

This is the error that i get when i change the input video file.

**Error: gst-stream-error-quark: Failed to parse stream (7): gstbaseparse.c(2954): gst\_base\_parse\_check\_sync (): /GstPipeline:pipeline0/GstH264Parse:h264-parser**

xxxx@xxxx-desktop:/opt/nvidia/deepstream/deepstream-5.0/sources/python/apps/deepstream-test1$ python3 deepstream\_test\_1.py /home/xxxx/Videos/1.mp4  
Creating Pipeline

Creating Source

Creating H264Parser

Creating Decoder

Creating EGLSink

Playing file /home/airpixagx1/Videos/1.mp4  
Warn: ‘threshold’ parameter has been deprecated. Use ‘pre-cluster-threshold’ instead.  
Adding elements to Pipeline

Linking elements in the Pipeline

Starting pipeline

Using winsys: x11  
Opening in BLOCKING MODE  
0:00:03.108948162 10800 0x3d31b590 INFO nvinfer gstnvinfer.cpp:602:gst\_nvinfer\_logger: NvDsInferContext[UID 1]: Info from NvDsInferContextImpl::deserializeEngineAndBackend() \<nvdsinfer\_context\_impl.cpp:1577\> [UID = 1]: deserialized trt engine from :/opt/nvidia/deepstream/deepstream-5.0/samples/models/Primary\_Detector/resnet10.caffemodel\_b1\_gpu0\_int8.engine  
INFO: [Implicit Engine Info]: layers num: 3  
0 INPUT kFLOAT input\_1 3x368x640  
1 OUTPUT kFLOAT conv2d\_bbox 16x23x40  
2 OUTPUT kFLOAT conv2d\_cov/Sigmoid 4x23x40

0:00:03.109184362 10800 0x3d31b590 INFO nvinfer gstnvinfer.cpp:602:gst\_nvinfer\_logger: NvDsInferContext[UID 1]: Info from NvDsInferContextImpl::generateBackendContext() \<nvdsinfer\_context\_impl.cpp:1681\> [UID = 1]: Use deserialized engine model: /opt/nvidia/deepstream/deepstream-5.0/samples/models/Primary\_Detector/resnet10.caffemodel\_b1\_gpu0\_int8.engine  
0:00:03.112393532 10800 0x3d31b590 INFO nvinfer gstnvinfer\_impl.cpp:311:notifyLoadModelStatus: [UID 1]: Load new model:dstest1\_pgie\_config.txt sucessfully  
Error: gst-stream-error-quark: Failed to parse stream (7): gstbaseparse.c(2954): gst\_base\_parse\_check\_sync (): /GstPipeline:pipeline0/GstH264Parse:h264-parser

---

<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:** [August 2, 2020, 4:31am UTC](https://forums.developer.nvidia.com/t/deepstream-python-error/144755/6 "2020-08-02T04:31:45Z")

</div>

As mentioned in the README of this sample, this sample only accpets \<h264\_elementary\_stream\>, so you need use H264 video instead of mp4 video.

Thanks!

---

<div class="post-metadata">

**Author:** ![airpixin](https://developer.download.nvidia.com/images/forums/profile-default-devtalk-84.png) [@airpixin](https://forums.developer.nvidia.com/u/airpixin)\
**Post date:** [August 2, 2020, 2:35pm UTC](https://forums.developer.nvidia.com/t/deepstream-python-error/144755/7 "2020-08-02T14:35:42Z")

</div>

What about this issue ?

---

<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:** [August 2, 2020, 3:12pm UTC](https://forums.developer.nvidia.com/t/deepstream-python-error/144755/8 "2020-08-02T15:12:18Z")

</div>

I have told what’s the mistake in your command.

What else do you want from our side???

---

<div class="post-metadata">

**Author:** ![airpixin](https://developer.download.nvidia.com/images/forums/profile-default-devtalk-84.png) [@airpixin](https://forums.developer.nvidia.com/u/airpixin)\
**Post date:** [August 2, 2020, 5:12pm UTC](https://forums.developer.nvidia.com/t/deepstream-python-error/144755/9 "2020-08-02T17:12:40Z")

</div>

Thanks for prompt reply,

I understand the issue about the H264 file.Thanks for letting me know.

Sorry I forgot to attach this block in the last reply.

Based on your initial changes I added “force-implicit-batch-dim=1” . And it works without giving any error . But the execution is stuck at this line.

**NvMMLiteBlockCreate : Block : BlockType = 261**

xxxx@xxxx-desktop:/opt/nvidia/deepstream/deepstream-5.0/sources/python/apps/deepstream-test1$ python3 deepstream\_test\_1.py …/…/…/…/samples/streams/sample\_720p.mp4  
Creating Pipeline

Creating Source

Creating H264Parser

Creating Decoder

Creating EGLSink

Playing file …/…/…/…/samples/streams/sample\_720p.mp4  
Warn: ‘threshold’ parameter has been deprecated. Use ‘pre-cluster-threshold’ instead.  
Adding elements to Pipeline

Linking elements in the Pipeline

Starting pipeline

Using winsys: x11  
Opening in BLOCKING MODE  
0:00:03.100719469 10327 0x3aecab90 INFO nvinfer gstnvinfer.cpp:602:gst\_nvinfer\_logger: NvDsInferContext[UID 1]: Info from NvDsInferContextImpl::deserializeEngineAndBackend() \<nvdsinfer\_context\_impl.cpp:1577\> [UID = 1]: deserialized trt engine from :/opt/nvidia/deepstream/deepstream-5.0/samples/models/Primary\_Detector/resnet10.caffemodel\_b1\_gpu0\_int8.engine  
INFO: [Implicit Engine Info]: layers num: 3  
0 INPUT kFLOAT input\_1 3x368x640  
1 OUTPUT kFLOAT conv2d\_bbox 16x23x40  
2 OUTPUT kFLOAT conv2d\_cov/Sigmoid 4x23x40

0:00:03.101016568 10327 0x3aecab90 INFO nvinfer gstnvinfer.cpp:602:gst\_nvinfer\_logger: NvDsInferContext[UID 1]: Info from NvDsInferContextImpl::generateBackendContext() \<nvdsinfer\_context\_impl.cpp:1681\> [UID = 1]: Use deserialized engine model: /opt/nvidia/deepstream/deepstream-5.0/samples/models/Primary\_Detector/resnet10.caffemodel\_b1\_gpu0\_int8.engine  
0:00:03.105303358 10327 0x3aecab90 INFO nvinfer gstnvinfer\_impl.cpp:311:notifyLoadModelStatus: [UID 1]: Load new model:dstest1\_pgie\_config.txt sucessfully  
NvMMLiteOpen : Block : BlockType = 261  
NVMEDIA: Reading vendor.tegra.display-size : status: 6  
NvMMLiteBlockCreate : Block : BlockType = 261

---

<div class="post-metadata">

**Author:** ![Amycao](https://sea2.discourse-cdn.com/nvidia/user_avatar/forums.developer.nvidia.com/amycao/32/11342_2.png) [@Amycao](https://forums.developer.nvidia.com/u/Amycao)\
**Post date:** [August 3, 2020, 1:59pm UTC](https://forums.developer.nvidia.com/t/deepstream-python-error/144755/10 "2020-08-03T13:59:03Z")

</div>

You could refer to test3 python sample which is using uridecodebin so that any type of input (e.g. RTSP/File), any GStreamer supported container format, and any codec can be used as input.  
Please note again, test1 python sample only accept h264 elementary stream.

---

<div class="post-metadata">

**Author:** ![airpixin](https://developer.download.nvidia.com/images/forums/profile-default-devtalk-84.png) [@airpixin](https://forums.developer.nvidia.com/u/airpixin)\
**Post date:** [August 4, 2020, 12:51pm UTC](https://forums.developer.nvidia.com/t/deepstream-python-error/144755/11 "2020-08-04T12:51:51Z")

</div>

Thank you !!

---

<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:17pm UTC](https://forums.developer.nvidia.com/t/deepstream-python-error/144755/13 "2021-10-12T16:17:04Z")

</div>


