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

how to export model ? #5

Open
kpthsu opened this issue Jan 5, 2024 · 5 comments
Open

how to export model ? #5

kpthsu opened this issue Jan 5, 2024 · 5 comments

Comments

@kpthsu
Copy link

kpthsu commented Jan 5, 2024

Hello
Amazing job!
I'm new here, and it was very interesting to see your plug-in examples.
To spent some time learning about python , installed yolo5 and flutter on my Windows desktop,
I was trying to figure out how to use 'python modified_export.py --weights yolov5s.pt --include torchscript coreml'.
After to change yolov5s.torchscript to yolov5s.pt,and put in asses/models.
The program crashed when I tried to run it on an android phone.
I try to put the yolov5_320.pt model in your directory example into the same directory as my flutter, it works!
May I ask why the yolov5s.pt provided by yoylv5 cannot be converted into the yolov5s_320.pt in your example?
I'm a beginner. Can you give me some advice?
Thank you.

@spring98
Copy link
Owner

spring98 commented Jan 5, 2024

hello! Thank you for your interest in my plugin.

It is difficult to predict what kind of problem there will be based on this information alone.

If you have an error log, could you leave it as it may help us solve the problem?

thank you

@kpthsu
Copy link
Author

kpthsu commented Jan 6, 2024

2024-01-06 11 14 24
I used yolov5's yolov5s.pt converted file to change androidModelPath and to add assets to pubspec.yam.
Didn't see YoloRealtimeController try catch ERROR: in log,Can you give me some advice?Thank you.

@spring98
Copy link
Owner

spring98 commented Jan 6, 2024

yasenh/libtorch-yolov5#21 (comment)

I also did some searching, and there seem to be two cases.

  1. Check CPU version and GPU version

  2. Check if model.model[-1].export = False

I hope this helps!

@kpthsu
Copy link
Author

kpthsu commented Jan 6, 2024

2024-01-06 16 14 31
2024-01-06 16 16 38
I tried to confirm the export output again.
The export result is successful.
But the size of the obtained 'yolov5s,torchscript' file is different from the size of your 'yolov5s_320.pt' file.
but 'Check if model.model[-1].export = False ', how to confirm this?Thank you.

@dxnghxn203
Copy link

Hello!
I solved the hassle.
I have changed androidModelHeight and androidModelWidth

Screenshot 2024-07-24 091702

(320, 320) => (640, 640)

Screenshot 2024-07-24 092601

from
Screenshot 2024-07-24 091523

I hope this helps!

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

3 participants