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

Exporting from yolov5 to coreml #8

Open
iceisfun opened this issue Sep 7, 2022 · 6 comments
Open

Exporting from yolov5 to coreml #8

iceisfun opened this issue Sep 7, 2022 · 6 comments

Comments

@iceisfun
Copy link

iceisfun commented Sep 7, 2022

having trouble exporting our ultralytics yolov5 models to coreml.

git clone repo, cd repo, checkout fix/coreml_export_nms_layer, install req, run export cmd

python3 export.py --weights ../../output/best.pt --include coreml

... lots of stuff happening, and eventually ...

added const 10 for builder <coremltools.models.neural_network.builder.NeuralNetworkBuilder object at 0x7f078bb94580>
added const 11 for builder <coremltools.models.neural_network.builder.NeuralNetworkBuilder object at 0x7f078bb94580>
added const 12 for builder <coremltools.models.neural_network.builder.NeuralNetworkBuilder object at 0x7f078bb94580>
Translating MIL ==> NeuralNetwork Ops: 97%|██████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████▋ | 656/678 [00:00<00:00, 1012.99 ops/s]added const 878 for builder <coremltools.models.neural_network.builder.NeuralNetworkBuilder object at 0x7f078bb94580>
Translating MIL ==> NeuralNetwork Ops: 100%|████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 678/678 [00:00<00:00, 1160.80 ops/s]

CoreML: export failure: 0 has type int, but expected one of: bytes, unicode
/usr/src/app/temp/yolov5#

if its helpful we can share our best.pt.

@eneskosr
Copy link

same here. @iceisfun did you manage to solve it?

@Archer-204
Copy link

Same issue here. @iceisfun did you find a way out?

@eneskosr
Copy link

@Archer-204 i have found a solution. i will post it tonight.

@Archer-204
Copy link

@eneskosr Appreciated!!!!!

@eneskosr
Copy link

eneskosr commented Oct 19, 2022

i have uploaded my export_nms.py to a repo. can you check it out? @Archer-204 https://github.com/eneskosr/yolov5-coreml-export

@Archer-204
Copy link

i have uploaded my export_nms.py to a repo. can you check it out? @Archer-204 https://github.com/eneskosr/yolov5-coreml-export

Thanks! It works! 👍

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