DanaHan / Yolov5-in-Deepstream-5.0

Describe how to use yolov5 in Deepstream 5.0
208 stars 56 forks source link

Deserialize the cuda engine failed #1

Closed yanivnahum closed 3 years ago

yanivnahum commented 4 years ago

Hi @DanaHan , Getting the following error running the deepstream-app:

ERROR: [TRT]: INVALID_ARGUMENT: getPluginCreator could not find plugin HardSwishLayer_TRT version 1 ERROR: [TRT]: safeDeserializationUtils.cpp (323) - Serialization Error in load: 0 (Cannot deserialize plugin since corresponding IPluginCreator not found in Plugin Registry) ERROR: [TRT]: INVALID_STATE: std::exception ERROR: [TRT]: INVALID_CONFIG: Deserialize the cuda engine failed. ERROR: Deserialize engine failed from file: /opt/nvidia/deepstream/deepstream-5.0/sources/objectDetector_Yolo/yolov5s.engine 0:00:02.210030991 2403 0x3fbb2790 WARN nvinfer gstnvinfer.cpp:616:gst_nvinfer_logger: NvDsInferContext[UID 1]: Warning from NvDsInferContextImpl::deserializeEngineAndBackend() [UID = 1]: deserialize engine from file :/opt/nvidia/deepstream/deepstream-5.0/sources/objectDetector_Yolo/yolov5s.engine failed 0:00:02.210150640 2403 0x3fbb2790 WARN nvinfer gstnvinfer.cpp:616:gst_nvinfer_logger: NvDsInferContext[UID 1]: Warning from NvDsInferContextImpl::generateBackendContext() [UID = 1]: deserialize backend context from engine from file :/opt/nvidia/deepstream/deepstream-5.0/sources/objectDetector_Yolo/yolov5s.engine failed, try rebuild 0:00:02.210198256 2403 0x3fbb2790 INFO nvinfer gstnvinfer.cpp:619:gst_nvinfer_logger: NvDsInferContext[UID 1]: Info from NvDsInferContextImpl::buildModel() [UID = 1]: Trying to create engine from model files Yolo type is not defined from config file name: ERROR: Failed to create network using custom network creation function ERROR: Failed to get cuda engine from custom library API

any idea? Thanks

DanaHan commented 4 years ago

In Yolov5, HardSwishLayer which isn't support by tensorrt is customized by a plugin. So you need to use LD_PRELOAD to load libmyplugin.so.

tamisalex commented 4 years ago

To follow up LD_PRELOAD=~/libmyplugin.so deepstream-app -c config.txt

I think this should be included in README.md

yanivnahum commented 3 years ago

I just came back to it. working great. thanks @DanaHan @tamisalex