Model engine error, deepstream-test1, python bindings

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 to execute on deepstream docker

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

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?

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

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.

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;
}

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.

Hi 17502156337,

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