# Model engine error, deepstream-test1, python bindings

**URL:** <https://forums.developer.nvidia.com/t/model-engine-error-deepstream-test1-python-bindings/155035>\
**Category:** DeepStream SDK\
**Created:** [September 22, 2020, 7:21pm UTC](https://forums.developer.nvidia.com/t/model-engine-error-deepstream-test1-python-bindings/155035 "2020-09-22T19:21:48Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![leo2105](https://sea2.discourse-cdn.com/nvidia/user_avatar/forums.developer.nvidia.com/leo2105/32/27757_2.png) [@leo2105](https://forums.developer.nvidia.com/u/leo2105)\
**Post date:** [September 22, 2020, 7:21pm UTC](https://forums.developer.nvidia.com/t/model-engine-error-deepstream-test1-python-bindings/155035/1 "2020-09-22T19:21:48Z")

</div>

Please provide complete information as applicable to your setup.  
• Hardware Platform : GTX1080TI  
• DeepStream version : 5.0  
• TensorRT version : 7.0  
• NVIDIA GPU Driver Version : 440.33.01  
• Issue type : bugs

I am running deepstream\_test-1, I followed all of this [README](https://github.com/NVIDIA-AI-IOT/deepstream_python_apps/blob/master/apps/README) to execute on [deepstream docker](https://ngc.nvidia.com/catalog/containers/nvidia:deepstream)

Input:  
`python3 deepstream_test_1.py /opt/nvidia/deepstream/deepstream-5.0/samples/streams/sample_1080p_h264.mp4`

Output:

> Creating Pipeline
> 
> Creating Source
> 
> Creating H264Parser
> 
> Creating Decoder
> 
> Creating EGLSink
> 
> Playing file /opt/nvidia/deepstream/deepstream-5.0/samples/streams/sample\_1080p\_h264.mp4  
> Error: Could not parse model engine file path  
> Failed to parse group property  
> \*\* ERROR: \<gst\_nvinfer\_parse\_config\_file:1242\>: failed  
> Adding elements to Pipeline
> 
> Linking elements in the Pipeline
> 
> Starting pipeline
> 
> 0:00:00.236785586 2784 0x19b2560 WARN nvinfer gstnvinfer.cpp:766:gst\_nvinfer\_start: error: Configuration file parsing failed  
> 0:00:00.236801600 2784 0x19b2560 WARN nvinfer gstnvinfer.cpp:766:gst\_nvinfer\_start: error: Config file path: dstest1\_pgie\_config.txt  
> Error: gst-library-error-quark: Configuration file parsing failed (5): gstnvinfer.cpp(766): gst\_nvinfer\_start (): /GstPipeline:pipeline0/GstNvInfer:primary-inference:  
> Config file path: dstest1\_pgie\_config.txt

dstest1\_pgie\_config.txt:

> [property]  
> gpu-id=0  
> net-scale-factor=0.0039215697906911373  
> model-file=/opt/nvidia/deepstream/deepstream-5.0/samples/models/Primary\_Detector/resnet10.caffemodel  
> proto-file=/opt/nvidia/deepstream/deepstream-5.0/samples/models/Primary\_Detector/resnet10.prototxt  
> model-engine-file=/opt/nvidia/deepstream/deepstream-5.0/samples/models/Primary\_Detector/resnet10.caffemodel\_b1\_gpu0\_int8.engine  
> labelfile-path=/opt/nvidia/deepstream/deepstream-5.0/samples/models/Primary\_Detector/labels.txt  
> int8-calib-file=/opt/nvidia/deepstream/deepstream-5.0/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  
> #scaling-filter=0  
> #scaling-compute-hw=0
> 
> [class-attrs-all]  
> pre-cluster-threshold=0.2  
> eps=0.2  
> group-threshold=1

So, I have 2 doubts:

- the code automatically generate mdoel-engine-file? because I dont have it in that path.
- About the last error (`/GstNvInfer:primary-inference`), I had the same one for deepstream-test4, if you can help, thanks

---

<div class="post-metadata">

**Author:** ![leo2105](https://sea2.discourse-cdn.com/nvidia/user_avatar/forums.developer.nvidia.com/leo2105/32/27757_2.png) [@leo2105](https://forums.developer.nvidia.com/u/leo2105)\
**Post date:** [September 22, 2020, 7:51pm UTC](https://forums.developer.nvidia.com/t/model-engine-error-deepstream-test1-python-bindings/155035/2 "2020-09-22T19:51:22Z")

</div>

Actually, I solved the problem but I had to generate the `resnet10.caffemodel_b1_gpu0_int8.engine` running the make file in `/opt/nvidia/deepstream/deepstream-5.0/sources/apps/sample_apps/deepstream-test1`

But suppose I just want to run only in python (`/opt/nvidia/deepstream/deepstream-5.0/sources/python/`), how to do it? because I had to use C files to creat it or I am wrong?

---

<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:** [September 24, 2020, 1:57am UTC](https://forums.developer.nvidia.com/t/model-engine-error-deepstream-test1-python-bindings/155035/4 "2020-09-24T01:57:54Z")

</div>

no matter c version or python version, it will generate engine file in the path specified.

---

<div class="post-metadata">

**Author:** ![leo2105](https://sea2.discourse-cdn.com/nvidia/user_avatar/forums.developer.nvidia.com/leo2105/32/27757_2.png) [@leo2105](https://forums.developer.nvidia.com/u/leo2105)\
**Post date:** [September 24, 2020, 2:54pm UTC](https://forums.developer.nvidia.com/t/model-engine-error-deepstream-test1-python-bindings/155035/5 "2020-09-24T14:54:43Z")

</div>

Thats my question, I run this command

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

and return this error:

```
Error: Could not parse model engine file path
Failed to parse group property
** ERROR: <gst_nvinfer_parse_config_file:1242>: failed

```

Obviously, because It cant find `.engine` file.  
So, the python program doesn’t create this file automatically as I see, idk why, unlike of this program (`/opt/nvidia/deepstream/deepstream-5.0/sources/apps/sample_apps/deepstream-test1/deepstream_test1`), which do create it.

---

<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:** [September 24, 2020, 4:26pm UTC](https://forums.developer.nvidia.com/t/model-engine-error-deepstream-test1-python-bindings/155035/6 "2020-09-24T16:26:23Z")

</div>

Hi @leo2105,  
It’s not because it’s python. The root cause is you give absolute path to the model, i.e

`model-engine-file=/opt/nvidia/deepstream/deepstream-5.0/samples/models/Primary_Detector/resnet10.caffemodel_b1_gpu0_int8.engine`

When you give it path started with “/”, it will run into below “if (file\_path[0] == ‘/’) {” and fail on realpath() function, and then report Error - “Error: Could not parse model engine file path” because the engine file does not exist.

Maybe this is a bug of DeepStream, we will discuss this internally,

Thanks for chasing this issue!

**File** : /opt/nvidia/deepstream/deepstream-5.0/sources/gst-plugins/gst-nvinfer/gstnvinfer\_property\_parser.cpp

> static gboolean  
> get\_absolute\_file\_path (  
> const gchar \* cfg\_file\_path, const gchar \* file\_path,  
> char \*abs\_path\_str)  
> {  
> gchar abs\_cfg\_path[PATH\_MAX + 1];  
> gchar abs\_real\_file\_path[PATH\_MAX + 1];  
> gchar \*abs\_file\_path;  
> gchar \*delim;
> 
> /\* Absolute path. No need to resolve further. _/  
> **if (file\_path[0] == ‘/’) {**  
> /_ Check if the file exists, return error if not. \*/  
> **if (!realpath (file\_path, abs\_real\_file\_path)) {**  
> **return FALSE;**  
> **}**  
> g\_strlcpy (abs\_path\_str, abs\_real\_file\_path, \_PATH\_MAX);  
> return TRUE;  
> }  
> …

---

<div class="post-metadata">

**Author:** ![17502156337](https://developer.download.nvidia.com/images/forums/profile-default-devtalk-84.png) [@17502156337](https://forums.developer.nvidia.com/u/17502156337)\
**Post date:** [February 14, 2021, 7:58am UTC](https://forums.developer.nvidia.com/t/model-engine-error-deepstream-test1-python-bindings/155035/8 "2021-02-14T07:58:52Z")

</div>

Hi,

I found that it still couldn’t support the absolute path.  
Have we had it fixed later on?  
And I’d like to know what the realpath function is doing?  
Thanks.

---

<div class="post-metadata">

**Author:** ![kayccc](https://sea2.discourse-cdn.com/nvidia/user_avatar/forums.developer.nvidia.com/kayccc/32/14043_2.png) [@kayccc](https://forums.developer.nvidia.com/u/kayccc)\
**Post date:** [February 23, 2021, 2:37am UTC](https://forums.developer.nvidia.com/t/model-engine-error-deepstream-test1-python-bindings/155035/9 "2021-02-23T02:37:44Z")

</div>

Hi 17502156337,

Please help to open a new topic with more details of your issue. Thanks

---

<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:15pm UTC](https://forums.developer.nvidia.com/t/model-engine-error-deepstream-test1-python-bindings/155035/10 "2021-10-12T16:15:04Z")

</div>

Closed on October 12, 2021, 4:15pm UTC


