# Deepstream python sample"deepstream-test1" does not run

**URL:** <https://forums.developer.nvidia.com/t/deepstream-python-sample-deepstream-test1-does-not-run/264096>\
**Category:** DeepStream SDK\
**Tags:** gstreamer, cuda\
**Created:** [August 23, 2023, 2:22pm UTC](https://forums.developer.nvidia.com/t/deepstream-python-sample-deepstream-test1-does-not-run/264096 "2023-08-23T14:22:26Z")\
**Posts on this page:** 11\
**Page:** 1

<div class="post-metadata">

**Author:** ![magnus.gabell](https://developer.download.nvidia.com/images/forums/profile-default-devtalk-84.png) [@magnus.gabell](https://forums.developer.nvidia.com/u/magnus.gabell)\
**Post date:** [August 23, 2023, 2:22pm UTC](https://forums.developer.nvidia.com/t/deepstream-python-sample-deepstream-test1-does-not-run/264096/1 "2023-08-23T14:22:26Z")

</div>

I have

**• Hardware Platform Jetson AGX Orin**  
**• DeepStream 6.2**  
\*\*• JetPack Version not sure, \*\*  
**• Tegra: 35 (release), REVISION: 3.1, GCID: 32827747, BOARD: t186ref, EABI: aarch64, DATE: Sun Mar 19 15:19:21 UTC 2023**•  
**• TensorRT Version: 8.5.2-1+cuda11.4**

I have tried to run the SDK Sample pack, “Deepstream-test1” with the  
/opt/nvidia/deepstream/deepstream/samples/streams/sample\_1080p\_h264.mp4

Config file:  
[property]  
gpu-id=0  
net-scale-factor=0.0039215697906911373  
model-file=/opt/nvidia/deepstream/deepstream-6.2/samples/models/Primary\_Detector/resnet10.caffemodel  
proto-file=/opt/nvidia/deepstream/deepstream-6.2/samples/models/Primary\_Detector/resnet10.prototxt  
model-engine-file=/opt/nvidia/deepstream/deepstream-6.2/samples/models/Primary\_Detector/resnet10.caffemodel\_b1\_gpu0\_int8.engine  
labelfile-path=/opt/nvidia/deepstream/deepstream-6.2/samples/models/Primary\_Detector/labels.txt  
int8-calib-file=/opt/nvidia/deepstream/deepstream-6.2/samples/models/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  
#scaling-filter=0  
#scaling-compute-hw=0

runnig by testing both as sudo and user:  
python3 deepstream\_test\_1.py /opt/nvidia/deepstream/deepstream/samples/streams/sample\_1080p\_h264.mp4

ERROR:  
Opening in BLOCKING MODE  
0:00:00.310888790 11235 0xa036190 WARN nvinfer gstnvinfer.cpp:677:gst\_nvinfer\_logger: NvDsInferContext[UID 1]: Warning from NvDsInferContextImpl::initialize() \<nvdsinfer\_context\_impl.cpp:1170\> [UID = 1]: Warning, OpenCV has been deprecated. Using NMS for clustering instead of cv::groupRectangles with topK = 20 and NMS Threshold = 0.5  
WARNING: Deserialize engine failed because file path: /opt/nvidia/deepstream/deepstream-6.2/samples/models/Primary\_Detector/resnet10.caffemodel\_b1\_gpu0\_int8.engine open error  
0:00:03.491444604 11235 0xa036190 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/samples/models/Primary\_Detector/resnet10.caffemodel\_b1\_gpu0\_int8.engine failed  
0:00:03.696750652 11235 0xa036190 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/samples/models/Primary\_Detector/resnet10.caffemodel\_b1\_gpu0\_int8.engine failed, try rebuild  
0:00:03.696811516 11235 0xa036190 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  
WARNING: [TRT]: The implicit batch dimension mode has been deprecated. Please create the network with NetworkDefinitionCreationFlag::kEXPLICIT\_BATCH flag whenever possible.  
WARNING: INT8 calibration file not specified. Trying FP16 mode.  
WARNING: [TRT]: TensorRT encountered issues when converting weights between types and that could affect accuracy.  
WARNING: [TRT]: If this is not the desired behavior, please modify the weights or retrain with regularization to adjust the magnitude of the weights.  
WARNING: [TRT]: Check verbose logs for the list of affected weights.  
WARNING: [TRT]: - 16 weights are affected by this issue: Detected subnormal FP16 values.  
WARNING: [TRT]: - 13 weights are affected by this issue: Detected values less than smallest positive FP16 subnormal value and converted them to the FP16 minimum subnormalized value.  
WARNING: Serialize engine failed because of file path: /opt/nvidia/deepstream/deepstream-6.2/samples/models/Primary\_Detector/resnet10.caffemodel\_b1\_gpu0\_fp16.engine opened error  
0:00:46.629952180 11235 0xa036190 WARN nvinfer gstnvinfer.cpp:677:gst\_nvinfer\_logger: NvDsInferContext[UID 1]: Warning from NvDsInferContextImpl::buildModel() \<nvdsinfer\_context\_impl.cpp:1950\> [UID = 1]: failed to serialize cude engine to file: /opt/nvidia/deepstream/deepstream-6.2/samples/models/Primary\_Detector/resnet10.caffemodel\_b1\_gpu0\_fp16.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:46.889340544 11235 0xa036190 INFO nvinfer gstnvinfer\_impl.cpp:328:notifyLoadModelStatus: [UID 1]: Load new model:dstest1\_pgie\_config.txt sucessfully  
Error: gst-stream-error-quark: Internal data stream error. (1): gstbaseparse.c(3666): gst\_base\_parse\_loop (): /GstPipeline:pipeline0/GstH264Parse:h264-parser:  
streaming stopped, reason not-negotiated (-4)  
nvstreammux: Successfully handled EOS for source\_id=0

I have tried a config-file with the deepstream-app and that work. The video I use is the particular file is used in the deepstream-app test and works. I see the cars and people. I also tried another source by adding my v4l2 camera and it works. Running the test app with the same configuration and files/camera in python app does not work. I have built the pyds from the 6.2 (Verision 1.1.8).

What can I do? any ideas?

---

<div class="post-metadata">

**Author:** ![yingliu](https://sea2.discourse-cdn.com/nvidia/user_avatar/forums.developer.nvidia.com/yingliu/32/136703_2.png) [@yingliu](https://forums.developer.nvidia.com/u/yingliu)\
**Post date:** [August 23, 2023, 2:35pm UTC](https://forums.developer.nvidia.com/t/deepstream-python-sample-deepstream-test1-does-not-run/264096/2 "2023-08-23T14:35:32Z")

</div>

> [@magnus.gabell](#):
>
> I have tried to run the SDK Sample pack, “Deepstream-test1” with the  
> /opt/nvidia/deepstream/deepstream/samples/streams/sample\_1080p\_h264.mp4

Please use the h264 stream file.  
You can check the pipeline in the code, plugin “h264parse” is used after filesrc, it only accept h264 stream.

---

<div class="post-metadata">

**Author:** ![magnus.gabell](https://developer.download.nvidia.com/images/forums/profile-default-devtalk-84.png) [@magnus.gabell](https://forums.developer.nvidia.com/u/magnus.gabell)\
**Post date:** [August 23, 2023, 2:52pm UTC](https://forums.developer.nvidia.com/t/deepstream-python-sample-deepstream-test1-does-not-run/264096/4 "2023-08-23T14:52:29Z")

</div>

I dont understand. I do use the h264 sample file.

---

<div class="post-metadata">

**Author:** ![yingliu](https://sea2.discourse-cdn.com/nvidia/user_avatar/forums.developer.nvidia.com/yingliu/32/136703_2.png) [@yingliu](https://forums.developer.nvidia.com/u/yingliu)\
**Post date:** [August 23, 2023, 3:08pm UTC](https://forums.developer.nvidia.com/t/deepstream-python-sample-deepstream-test1-does-not-run/264096/5 "2023-08-23T15:08:01Z")

</div>

> [@magnus.gabell](#):
>
> python3 deepstream\_test\_1.py /opt/nvidia/deepstream/deepstream/samples/streams/sample\_1080p\_h264.mp4

h264 file is pure h264 stream, while mp4 is a container which mux other information, a demux is needed to get the h264 stream in it.  
Can you try this？just use the file with postfix “h264”.

`python3 deepstream_test_1.py /opt/nvidia/deepstream/deepstream/samples/streams/sample_720p.h264`

---

<div class="post-metadata">

**Author:** ![magnus.gabell](https://developer.download.nvidia.com/images/forums/profile-default-devtalk-84.png) [@magnus.gabell](https://forums.developer.nvidia.com/u/magnus.gabell)\
**Post date:** [August 23, 2023, 3:59pm UTC](https://forums.developer.nvidia.com/t/deepstream-python-sample-deepstream-test1-does-not-run/264096/6 "2023-08-23T15:59:39Z")

</div>

Thank you! now it works but with the warnings. It should then work just fine with gstreamer as long as I fix the pipeline. Thanks!

How can I fix this open engine error?  
Deserialize engine failed because file path: /opt/nvidia/deepstream/deepstream-6.2/samples/models/Primary\_Detector/resnet10.caffemodel\_b1\_gpu0\_int8.engine open error

0:00:00.264654822 3462 0x385c3590 WARN nvinfer gstnvinfer.cpp:677:gst\_nvinfer\_logger: NvDsInferContext[UID 1]: Warning from NvDsInferContextImpl::initialize() \<nvdsinfer\_context\_impl.cpp:1170\> [UID = 1]: Warning, OpenCV has been deprecated. Using NMS for clustering instead of cv::groupRectangles with topK = 20 and NMS Threshold = 0.5  
WARNING: Deserialize engine failed because file path: /opt/nvidia/deepstream/deepstream-6.2/samples/models/Primary\_Detector/resnet10.caffemodel\_b1\_gpu0\_int8.engine open error  
0:00:04.167325593 3462 0x385c3590 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/samples/models/Primary\_Detector/resnet10.caffemodel\_b1\_gpu0\_int8.engine failed  
0:00:04.366508454 3462 0x385c3590 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/samples/models/Primary\_Detector/resnet10.caffemodel\_b1\_gpu0\_int8.engine failed, try rebuild  
0:00:04.366579652 3462 0x385c3590 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  
WARNING: [TRT]: The implicit batch dimension mode has been deprecated. Please create the network with NetworkDefinitionCreationFlag::kEXPLICIT\_BATCH flag whenever possible.  
WARNING: INT8 calibration file not specified. Trying FP16 mode.  
WARNING: [TRT]: TensorRT encountered issues when converting weights between types and that could affect accuracy.  
WARNING: [TRT]: If this is not the desired behavior, please modify the weights or retrain with regularization to adjust the magnitude of the weights.  
WARNING: [TRT]: Check verbose logs for the list of affected weights.  
WARNING: [TRT]: - 16 weights are affected by this issue: Detected subnormal FP16 values.  
WARNING: [TRT]: - 13 weights are affected by this issue: Detected values less than smallest positive FP16 subnormal value and converted them to the FP16 minimum subnormalized value.  
WARNING: Serialize engine failed because of file path: /opt/nvidia/deepstream/deepstream-6.2/samples/models/Primary\_Detector/resnet10.caffemodel\_b1\_gpu0\_fp16.engine opened error  
0:00:52.728890919 3462 0x385c3590 WARN nvinfer gstnvinfer.cpp:677:gst\_nvinfer\_logger: NvDsInferContext[UID 1]: Warning from NvDsInferContextImpl::buildModel() \<nvdsinfer\_context\_impl.cpp:1950\> [UID = 1]: failed to serialize cude engine to file: /opt/nvidia/deepstream/deepstream-6.2/samples/models/Primary\_Detector/resnet10.caffemodel\_b1\_gpu0\_fp16.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:53.005558631 3462 0x385c3590 INFO nvinfer gstnvinfer\_impl.cpp:328:notifyLoadModelStatus: [UID 1]: Load new model:dstest1\_pgie\_config.txt sucessfully  
NvMMLiteOpen : Block : BlockType = 261

---

<div class="post-metadata">

**Author:** ![yingliu](https://sea2.discourse-cdn.com/nvidia/user_avatar/forums.developer.nvidia.com/yingliu/32/136703_2.png) [@yingliu](https://forums.developer.nvidia.com/u/yingliu)\
**Post date:** [August 24, 2023, 1:13am UTC](https://forums.developer.nvidia.com/t/deepstream-python-sample-deepstream-test1-does-not-run/264096/7 "2023-08-24T01:13:16Z")

</div>

> [@magnus.gabell](#):
>
> Deserialize engine failed because file path: /opt/nvidia/deepstream/deepstream-6.2/samples/models/Primary\_Detector/resnet10.caffemodel\_b1\_gpu0\_int8.engine open error

This is by default the engine file config is set `model-engine-file=../../../../samples/models/Primary_Detector/resnet10.caffemodel_b1_gpu0_int8.engine`, but it doesn’t exist until it is created dring the first run. You can find this file after the sample program runs correctly, and if you run this program again, it can deserialize the engine file correctly without this warning.

---

<div class="post-metadata">

**Author:** ![junshengy](https://sea2.discourse-cdn.com/nvidia/user_avatar/forums.developer.nvidia.com/junshengy/32/251332_2.png) [@junshengy](https://forums.developer.nvidia.com/u/junshengy)\
**Post date:** [August 24, 2023, 2:17am UTC](https://forums.developer.nvidia.com/t/deepstream-python-sample-deepstream-test1-does-not-run/264096/8 "2023-08-24T02:17:15Z")

</div>

> [@magnus.gabell](#):
>
> Deserialize engine failed because file path: /opt/nvidia/deepstream/deepstream-6.2/samples/models/Primary\_Detector/resnet10.caffemodel\_b1\_gpu0\_int8.engine open error

It’s not an error, it’s just that the engine files cannot be found. Since deepstream is installed in /opt, only the root user has write access to this folder.

You can try `chmod 777 -R /opt/nvidia/deepstream`.

---

<div class="post-metadata">

**Author:** ![magnus.gabell](https://developer.download.nvidia.com/images/forums/profile-default-devtalk-84.png) [@magnus.gabell](https://forums.developer.nvidia.com/u/magnus.gabell)\
**Post date:** [August 24, 2023, 1:27pm UTC](https://forums.developer.nvidia.com/t/deepstream-python-sample-deepstream-test1-does-not-run/264096/9 "2023-08-24T13:27:47Z")

</div>

Hi, I tried to sudo it and it did not change the outcome. Still the warnings.

> Blockquote  
> Opening in BLOCKING MODE  
> 0:00:00.294466952 6382 0x3ea6f590 WARN nvinfer gstnvinfer.cpp:677:gst\_nvinfer\_logger: NvDsInferContext[UID 1]: Warning from NvDsInferContextImpl::initialize() \<nvdsinfer\_context\_impl.cpp:1170\> [UID = 1]: Warning, OpenCV has been deprecated. Using NMS for clustering instead of cv::groupRectangles with topK = 20 and NMS Threshold = 0.5  
> WARNING: Deserialize engine failed because file path: /opt/nvidia/deepstream/deepstream-6.2/samples/models/Primary\_Detector/resnet10.caffemodel\_b1\_gpu0\_int8.engine open error  
> 0:00:03.610929666 6382 0x3ea6f590 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/samples/models/Primary\_Detector/resnet10.caffemodel\_b1\_gpu0\_int8.engine failed  
> 0:00:03.811346240 6382 0x3ea6f590 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/samples/models/Primary\_Detector/resnet10.caffemodel\_b1\_gpu0\_int8.engine failed, try rebuild  
> 0:00:03.811418912 6382 0x3ea6f590 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  
> WARNING: [TRT]: The implicit batch dimension mode has been deprecated. Please create the network with NetworkDefinitionCreationFlag::kEXPLICIT\_BATCH flag whenever possible.  
> WARNING: INT8 calibration file not specified. Trying FP16 mode.  
> ^C^CWARNING: [TRT]: TensorRT encountered issues when converting weights between types and that could affect accuracy.  
> WARNING: [TRT]: If this is not the desired behavior, please modify the weights or retrain with regularization to adjust the magnitude of the weights.  
> WARNING: [TRT]: Check verbose logs for the list of affected weights.  
> WARNING: [TRT]: - 16 weights are affected by this issue: Detected subnormal FP16 values.  
> WARNING: [TRT]: - 13 weights are affected by this issue: Detected values less than smallest positive FP16 subnormal value and converted them to the FP16 minimum subnormalized value.  
> 0:00:49.135104401 6382 0x3ea6f590 INFO nvinfer gstnvinfer.cpp:680:gst\_nvinfer\_logger: NvDsInferContext[UID 1]: Info from NvDsInferContextImpl::buildModel() \<nvdsinfer\_context\_impl.cpp:1955\> [UID = 1]: serialize cuda engine to file: /opt/nvidia/deepstream/deepstream-6.2/samples/models/Primary\_Detector/resnet10.caffemodel\_b1\_gpu0\_fp16.engine successfully

---

<div class="post-metadata">

**Author:** ![junshengy](https://sea2.discourse-cdn.com/nvidia/user_avatar/forums.developer.nvidia.com/junshengy/32/251332_2.png) [@junshengy](https://forums.developer.nvidia.com/u/junshengy)\
**Post date:** [August 25, 2023, 1:40am UTC](https://forums.developer.nvidia.com/t/deepstream-python-sample-deepstream-test1-does-not-run/264096/10 "2023-08-25T01:40:45Z")

</div>

> [@magnus.gabell](#):
>
> /opt/nvidia/deepstream/deepstream-6.2/samples/models/Primary\_Detector/resnet10.caffemodel\_b1\_gpu0\_int8.engine

Is this file exist ? If the folder can be accessed right，the engine file can be saved.

When running again, the error will not appear.

---

<div class="post-metadata">

**Author:** ![magnus.gabell](https://developer.download.nvidia.com/images/forums/profile-default-devtalk-84.png) [@magnus.gabell](https://forums.developer.nvidia.com/u/magnus.gabell)\
**Post date:** [September 5, 2023, 7:55am UTC](https://forums.developer.nvidia.com/t/deepstream-python-sample-deepstream-test1-does-not-run/264096/11 "2023-09-05T07:55:21Z")

</div>

I set the access rights to the folder and it does not work. BUT it does run, it just takes a while and I can live with that for now. Thanks for the support. please engage in my more problematic topic of gst pipline :D

---

<div class="post-metadata">

**Author:** ![system](https://sea2.discourse-cdn.com/nvidia/user_avatar/forums.developer.nvidia.com/system/32/68080_2.png) [@system](https://forums.developer.nvidia.com/u/system)\
**Post date:** [September 19, 2023, 7:56am UTC](https://forums.developer.nvidia.com/t/deepstream-python-sample-deepstream-test1-does-not-run/264096/12 "2023-09-19T07:56:10Z")

</div>

Closed on September 19, 2023, 7:56am UTC

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