Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Run yolov5 using tensor rt #12968

Open
1 task done
tasyoooo opened this issue Apr 28, 2024 · 1 comment
Open
1 task done

Run yolov5 using tensor rt #12968

tasyoooo opened this issue Apr 28, 2024 · 1 comment
Labels
question Further information is requested

Comments

@tasyoooo
Copy link

Search before asking

Question

I exported Tensor RT weights (last.engine). When i use the weights in yolov5 detect it generates an error

File "detect.py", line 112, in run model = DetectMultiBackend(weights, device=device, dnn=dnn, data=data, fp16=half) File "C:\Users\shen\yolov5\models\common.py", line 426, in __init__ with open(w, "rb") as f, trt.Runtime(logger) as runtime: TypeError: pybind11::init(): factory function returned nullptr

Additional

No response

@tasyoooo tasyoooo added the question Further information is requested label Apr 28, 2024
@glenn-jocher
Copy link
Member

Hello! 😊 It looks like you're encountering an issue with deploying a TensorRT model in YOLOv5. This error often indicates a problem initializing the TensorRT engine from the .engine file. Here are a few suggestions that might help:

  1. Ensure the TensorRT engine was correctly built for your specific platform and GPU. Engines are not portable across different GPU architectures or TensorRT versions.
  2. Verify that your environment has the necessary dependencies for TensorRT inference, including the correct version of TensorRT installed.
  3. Check if the path to the .engine file in your detect.py invocation is correct and accessible.

If the issue persists, consider re-exporting your model to the TensorRT engine format, confirming each step's success. For guidance on model conversion and deployment using TensorRT with YOLOv5, our documentation can offer further insights: https://docs.ultralytics.com/yolov5/.

Feel free to share more details if you're still facing challenges. Good luck!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

2 participants