Failed to run the example(deepstream_image_meta_test)

Please provide complete information as applicable to your setup.

• Hardware Platform (Jetson / GPU)
• DeepStream Version
• JetPack Version (valid for Jetson only)
• TensorRT Version
• NVIDIA GPU Driver Version (valid for GPU only)
**• Issue Type( bugs)ERROR: Serialize engine failed because of file path: /opt/nvidia/deepstream/deepstream-5.1/samples/models/Primary_Detector/resnet10.caffemodel_b1_gpu0_int8.engine opened error

If engine file not created, it will report this error. and it will create engine file from the model file you provided.

@amycao Thanks. For resnet10.caffemodel, how do I create an engine file?

In deepstream, you do not need to generate tensorrt engine file. nvinfer plugin will generate. and it’s open sourced, you can go through and check.

Yes, I also found that deepstream does not need to generate engine files. I want to explain my question again.
Failed to run the example(deepstream_image_meta_test).How can I solve it?The following run commands and error prompts.
Run command:./deepstream-image-meta-test file:///opt/nvidia/deepstream/deepstream-5.1/samples/streams/sample_1080p_h264.mp4

**WARNING: Overriding infer-config batch-size (2) with number of sources (1)
Now playing: file:///opt/nvidia/deepstream/deepstream-5.1/samples/streams/sample_1080p_h264.mp4,

Using winsys: x11
0:00:00.292746632 10916 0x55a72ea750 INFO nvinfer gstnvinfer.cpp:619:gst_nvinfer_logger: NvDsInferContext[UID 1]: Info from NvDsInferContextImpl::buildModel() <nvdsinfer_context_impl.cpp:1716> [UID = 1]: Trying to create engine from model files
INFO: [TRT]: Reading Calibration Cache for calibrator: EntropyCalibration2
INFO: [TRT]: Generated calibration scales using calibration cache. Make sure that calibration cache has latest scales.
INFO: [TRT]: To regenerate calibration cache, please delete the existing one. TensorRT will generate a new calibration cache.
INFO: [TRT]:
INFO: [TRT]: --------------- Layers running on DLA:
INFO: [TRT]:
INFO: [TRT]: --------------- Layers running on GPU:
INFO: [TRT]: conv1 + activation_1/Relu, block_1a_conv_1 + activation_2/Relu, block_1a_conv_2, block_1a_conv_shortcut + add_1 + activation_3/Relu, block_2a_conv_1 + activation_4/Relu, block_2a_conv_2, block_2a_conv_shortcut + add_2 + activation_5/Relu, block_3a_conv_1 + activation_6/Relu, block_3a_conv_2, block_3a_conv_shortcut + add_3 + activation_7/Relu, block_4a_conv_1 + activation_8/Relu, block_4a_conv_2, block_4a_conv_shortcut + add_4 + activation_9/Relu, conv2d_cov, conv2d_cov/Sigmoid, conv2d_bbox,
INFO: [TRT]: Detected 1 inputs and 2 output network tensors.
ERROR: Serialize engine failed because of file path: /opt/nvidia/deepstream/deepstream-5.1/samples/models/Primary_Detector/resnet10.caffemodel_b1_gpu0_int8.engine opened error
0:00:17.421913260 10916 0x55a72ea750 WARN nvinfer gstnvinfer.cpp:616:gst_nvinfer_logger: NvDsInferContext[UID 1]: Warning from NvDsInferContextImpl::buildModel() <nvdsinfer_context_impl.cpp:1744> [UID = 1]: failed to serialize cude engine to file: /opt/nvidia/deepstream/deepstream-5.1/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:17.436445612 10916 0x55a72ea750 INFO nvinfer gstnvinfer_impl.cpp:313:notifyLoadModelStatus: [UID 1]: Load new model:ds_image_meta_pgie_config.txt sucessfully
Running…
Opening in BLOCKING MODE
Opening in BLOCKING MODE
NvMMLiteOpen : Block : BlockType = 261
NVMEDIA: Reading vendor.tegra.display-size : status: 6
NvMMLiteBlockCreate : Block : BlockType = 261
Segmentation fault (core dumped)

Which platform you are running on? i see you use version 5.1, please move to version 6.0 and have a try. we do not provide support with older version.

I just re-downloaded deepstream 6.0 recently, and running this program will also cause this problem (engine file cannot be generated), but I solved it because of permission issues.
Now when I run the deepstream_image_meta_test file,another problem appears, as follows:

mec@mec-desktop:/opt/nvidia/deepstream/deepstream-6.0/sources/apps/sample_apps/deepstream-image-meta-test$ ./deepstream-image-meta-test file:///opt/nvidia/deepstream/deepstream-6.0/samples/streams/sample_1080p_h264.mp4
WARNING: Overriding infer-config batch-size (2) with number of sources (1)
Now playing: file:///opt/nvidia/deepstream/deepstream-6.0/samples/streams/sample_1080p_h264.mp4,

Using winsys: x11
0:00:00.212847689   743   0x559ccc5720 WARN                 nvinfer gstnvinfer.cpp:635:gst_nvinfer_logger:<primary-nvinference-engine> NvDsInferContext[UID 1]: Warning from NvDsInferContextImpl::initialize() <nvdsinfer_context_impl.cpp:1161> [UID = 1]: Warning, OpenCV has been deprecated. Using NMS for clustering instead of cv::groupRectangles with topK = 20 and NMS Threshold = 0.5
0:00:00.213693841   743   0x559ccc5720 INFO                 nvinfer gstnvinfer.cpp:638:gst_nvinfer_logger:<primary-nvinference-engine> NvDsInferContext[UID 1]: Info from NvDsInferContextImpl::buildModel() <nvdsinfer_context_impl.cpp:1914> [UID = 1]: Trying to create engine from model files
WARNING: [TRT]: Detected invalid timing cache, setup a local cache instead
0:00:33.845820484   743   0x559ccc5720 INFO                 nvinfer gstnvinfer.cpp:638:gst_nvinfer_logger:<primary-nvinference-engine> NvDsInferContext[UID 1]: Info from NvDsInferContextImpl::buildModel() <nvdsinfer_context_impl.cpp:1947> [UID = 1]: serialize cuda engine to file: /opt/nvidia/deepstream/deepstream-6.0/samples/models/Primary_Detector/resnet10.caffemodel_b1_gpu0_int8.engine successfully
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:33.863330061   743   0x559ccc5720 INFO                 nvinfer gstnvinfer_impl.cpp:313:notifyLoadModelStatus:<primary-nvinference-engine> [UID 1]: Load new model:ds_image_meta_pgie_config.txt sucessfully
Running...
Opening in BLOCKING MODE
NvMMLiteOpen : Block : BlockType = 261
NVMEDIA: Reading vendor.tegra.display-size : status: 6
NvMMLiteBlockCreate : Block : BlockType = 261
Segmentation fault (core dumped)

Please help me.

Which platform you are running on?

deepstream6.0
jetson NX

Make sure you have write permission where you run the deepstream_image_meta_test app. you also can modify the app to write the file to another place where you have write permission without using sudo.

1 Like

Thank you.
It is indeed a permission issue, now I can run this example.
But the screenshot is an image of each target. I want to save a frame of image with a detection frame. How should I modify the program?

You can change the object bbox to contain the whole picture.
nvds_obj_enc_process (ctx, &userData, ip_surf, obj_meta, frame_meta);