ultralytics / yolov5

YOLOv5 🚀 in PyTorch > ONNX > CoreML > TFLite
https://docs.ultralytics.com
GNU Affero General Public License v3.0
50.65k stars 16.33k forks source link

Exporting yolov5 model as engine format never finishes #12442

Closed MorethanmeDev closed 11 months ago

MorethanmeDev commented 11 months ago

Search before asking

YOLOv5 Component

Export

Bug

This is what happens when exporting with onnx format: image everything works as normal.

And this is what happens when exporting with engine format: image It fails and just stops with no further information

I have seen another user @SeanSon2005 having the same issue in yolov8 but he wasn't clear in how he solved it and there are no similar issues on yolov5. Also neither yolov8's nor yolov5's export files have been updated to resolve the problem.

Environment

Minimal Reproducible Example

Just the export.py file from the yolov5 ultralitics repo

Additional

@SeanSon2005 who was having the same problem on yolov8 says that he fixed the problem by going into the Yolo export.py and moving the import tensorrt as trt code segment after getting the onnx export but I wasnt able to replicate that so if anyone follow up on that or elaborate on where I need to move the import tensorrt as trt code segment I would appreciate it even if it doesnt solve the issue.

Are you willing to submit a PR?

MorethanmeDev commented 11 months ago

Fixed by uninstalling the latest versions of torch and torchvision and installing torch 2.0.1 and torchvision 1.15.2 using nvidia cuda 118.

glenn-jocher commented 11 months ago

@MorethanmeDev glad to hear you were able to resolve the issue! The YOLOv5 repository thrives through community collaboration. If you have further inquiries, feel free to ask here or refer to our documentation at https://docs.ultralytics.com/yolov5/.