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

The torchscript weight from YoLoV5 is not workable #2

Open
Jelly123456 opened this issue Oct 5, 2020 · 7 comments
Open

The torchscript weight from YoLoV5 is not workable #2

Jelly123456 opened this issue Oct 5, 2020 · 7 comments

Comments

@Jelly123456
Copy link

Thanks very much for creating this repo.

Now I am facing one problem that the converted torchscript weight from YoLoV5 is not working with the code you provided.

The conversion is followed on this:
ultralytics/yolov5#251

The image size is set to [640, 640] and I also modified your code to be 640.

When loading your existing torchscript weight, it works perfectly.

Do you know which could be the reasons?

Thanks.

@Jelly123456
Copy link
Author

I solved this by changing some codes in the export.py from YoLoV5 repo.

@Nebula4869
Copy link
Owner

Nebula4869 commented Oct 6, 2020 via email

@Jelly123456
Copy link
Author

Thanks very much for your reply. Now I could not run with the torchscript model exported in GPU mode.
Do you know how to solve it?

@Jelly123456 Jelly123456 reopened this Oct 6, 2020
@FantasyJXF
Copy link

Export the torchscript with map_location=torch.device('cuda') will do

@yy2lyx
Copy link

yy2lyx commented Dec 17, 2020

I solved this by changing some codes in the export.py from YoLoV5 repo.

could you tell me the code where to change?PLZ

@1chimaruGin
Copy link

I solved this by changing some codes in the export.py from YoLoV5 repo.

could you tell me the code where to change?PLZ

https://github.com/ultralytics/yolov5/blob/69be8e738f45e7908c1270eedd350f98c0c7bfa4/models/export.py#L33

@Jelly123456
Copy link
Author

@1chimaruGin @yy2lyx
You can follow the instructions in this repo. I tried successfully with GPU + Linux environment.

https://github.com/yasenh/libtorch-yolov5

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

No branches or pull requests

5 participants