zhouyuchong / yolov5-deepstream-python

yolov5-deepstream-python
MIT License
7 stars 3 forks source link

最后执行的时候报错:Config file path: config/deepstream_yolov5_config.txt, NvDsInfer Error: NVDSINFER_CUSTOM_LIB_FAILED #2

Closed chengzihencai closed 1 year ago

chengzihencai commented 2 years ago

Using winsys: x11 Opening in BLOCKING MODE ERROR: Could not open lib: /opt/nvidia/deepstream/deepstream-6.0/sources/deepstream_python_apps/apps/yolov5-deepstream-python/config/nvdsinfer_custom_impl_Yolo/libnvdsinfer_custom_impl_Yolo.so, error string: /opt/nvidia/deepstream/deepstream-6.0/sources/deepstream_python_apps/apps/yolov5-deepstream-python/config/nvdsinfer_custom_impl_Yolo/libnvdsinfer_custom_impl_Yolo.so: cannot open shared object file: No such file or directory 0:00:00.667253475 20120 0x1d060210 ERROR nvinfer gstnvinfer.cpp:632:gst_nvinfer_logger:<primary-inference> NvDsInferContext[UID 1]: Error in NvDsInferContextImpl::initialize() <nvdsinfer_context_impl.cpp:1248> [UID = 1]: Could not open custom lib: (null) 0:00:00.667335617 20120 0x1d060210 WARN nvinfer gstnvinfer.cpp:841:gst_nvinfer_start:<primary-inference> error: Failed to create NvDsInferContext instance 0:00:00.667372128 20120 0x1d060210 WARN nvinfer gstnvinfer.cpp:841:gst_nvinfer_start:<primary-inference> error: Config file path: config/deepstream_yolov5_config.txt, NvDsInfer Error: NVDSINFER_CUSTOM_LIB_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(841): gst_nvinfer_start (): /GstPipeline:pipeline0/GstNvInfer:primary-inference: Config file path: config/deepstream_yolov5_config.txt, NvDsInfer Error: NVDSINFER_CUSTOM_LIB_FAILED `python3 main.py /opt/nvidia/deepstream/deepstream/samples/streams/sample_720p.h264

执行命令

` 请问是哪里出了问题?

zhouyuchong commented 2 years ago
error string: /opt/nvidia/deepstream/deepstream-6.0/sources/deepstream_python_apps/apps/yolov5-deepstream-python/config/nvdsinfer_custom_impl_Yolo/libnvdsinfer_custom_impl_Yolo.so: cannot open shared object file: No such file or directory

这里显示你的路径应该是不对的

chengzihencai commented 2 years ago

感谢帮助,我按照您在readme和博文内的说明重新进行了下载和配置:我的过程如下 1、git clone https://github.com/zhouyuchong/yolov5-deepstream-python 2、cd yolov5-deepstream-python 执行:CUDA_VER=10.2 make -C nvdsinfer_custom_impl_Yolo 3、将使用tensorrtx(wang-xinyu/tensorrtx: Implementation of popular deep learning networks with TensorRT network definition API (github.com))生成的yolov5s.engine和libmyplugins.so复制到文件内 4、将labels.txt复制到文件内 5、将yolov5-deepstream-python剪切到/opt/nvidia/deepstream/deepstream/sources/deepstream_python_apps/apps 内 6、修改main.py内的路径: ctypes.cdll.LoadLibrary(/opt/nvidia/deepstream/deepstream/sources/deepstream_python_apps/apps/yolov5-deepstream-python/libmyplugins.so ) 7、修改config/deepstream_yolov5_config.txt的路径: custom-lib-path = /opt/nvidia/deepstream/deepstream/sources/deepstream_python_apps/apps/yolov5-deepstream-python/nvdsinfer_custom_impl_Yolo/libnvdsinfer_custom_impl_Yolo.so

model-engine-file = /opt/nvidia/deepstream/deepstream/sources/deepstream_python_apps/apps/yolov5-deepstream-python/yolov5s.engine

labelfile-path = /opt/nvidia/deepstream/deepstream/sources/deepstream_python_apps/apps/yolov5-deepstream-python/labels.txt 8、cd yolov5-deepstream-python,执行命令:python3 main.py /opt/nvidia/deepstream/deepstream/samples/streams/sample_720p.h264

版本:jetpack 4.6 deepstream-app version 6.0.1 DeepStreamSDK 6.0.1 CUDA Driver Version: 10.2 CUDA Runtime Version: 10.2 TensorRT Version: 8.0 cuDNN Version: 8.2 libNVWarp360 Version: 2.0.1d3

chengzihencai commented 2 years ago

运行后报错误如下`/opt/nvidia/deepstream/deepstream-6.0/sources/deepstream_python_apps/apps/yolov5-deepstream-python$ python3 main.py /opt/nvidia/deepstream/deepstream/samples/streams/sample_720p.h264 Creating Pipeline

Creating Source

Creating H264Parser

Creating Decoder

Creating EGLSink

Playing file /opt/nvidia/deepstream/deepstream/samples/streams/sample_720p.h264 Adding elements to Pipeline

Linking elements in the Pipeline

Starting pipeline

Using winsys: x11 Opening in BLOCKING MODE ERROR: Could not open lib: /opt/nvidia/deepstream/deepstream-6.0/sources/deepstream_python_apps/apps/yolov5-deepstream-python/nvdsinfer_custom_impl_Yolo/libnvdsinfer_custom_impl_Yolo.so, error string: /opt/nvidia/deepstream/deepstream-6.0/sources/deepstream_python_apps/apps/yolov5-deepstream-python/nvdsinfer_custom_impl_Yolo/libnvdsinfer_custom_impl_Yolo.so: cannot open shared object file: No such file or directory 0:00:00.679138589 11649 0x40e85610 ERROR nvinfer gstnvinfer.cpp:632:gst_nvinfer_logger: NvDsInferContext[UID 1]: Error in NvDsInferContextImpl::initialize() [UID = 1]: Could not open custom lib: (null) 0:00:00.679244253 11649 0x40e85610 WARN nvinfer gstnvinfer.cpp:841:gst_nvinfer_start: error: Failed to create NvDsInferContext instance 0:00:00.679286237 11649 0x40e85610 WARN nvinfer gstnvinfer.cpp:841:gst_nvinfer_start: error: Config file path: config/deepstream_yolov5_config.txt, NvDsInfer Error: NVDSINFER_CUSTOM_LIB_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(841): gst_nvinfer_start (): /GstPipeline:pipeline0/GstNvInfer:primary-inference: Config file path: config/deepstream_yolov5_config.txt, NvDsInfer Error: NVDSINFER_CUSTOM_LIB_FAILED

` 请问是我哪里出现了问题?关于您之前回复我的路径,在这个错误出现后我按照报错信息中的路径检查,发现所提文件是存在的

zhouyuchong commented 2 years ago

@chengzihencai 你好,我尝试重新在新的镜像中clone并运行,并没有出现你所述的情况。 参考这个帖子的情况似乎和你的一致,我的建议也是请再仔细检查一下路径等相关。根据你的报错信息,也是该路径下没有找到这个so文件。

chengzihencai commented 2 years ago

好的,请问您的工程文件下载后需要make nvdsinfer_custom_impl_Yolo吗?我执行make nvdsinfer_custom_impl_Yolo 输出make: Nothing to be done for 'nvdsinfer_custom_impl_Yolo'.这是编译过的文件吗?

zhouyuchong commented 2 years ago

@chengzihencai 你可以删除现存的so文件,进入目录后重新make编译生成一次试试。