-
-
Notifications
You must be signed in to change notification settings - Fork 16.2k
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
CoreML convert error #315
Comments
Hello @mathpopo, thank you for your interest in our work! Please visit our Custom Training Tutorial to get started, and see our Jupyter Notebook , Docker Image, and Google Cloud Quickstart Guide for example environments. If this is a bug report, please provide screenshots and minimum viable code to reproduce your issue, otherwise we can not help you. If this is a custom model or data training question, please note that Ultralytics does not provide free personal support. As a leader in vision ML and AI, we do offer professional consulting, from simple expert advice up to delivery of fully customized, end-to-end production solutions for our clients, such as:
For more information please visit https://www.ultralytics.com. |
@mathpopo we have updated We do offer paid end-to-end export services however, as well as providing reference apps for iOS and Android to use your exported models in. If you have a business idea for YOLOv5 at the edge, we'd be happy to help you get started! You can email glenn.jocher@ultralytics.com for details if interested. |
Building from source the latest coremltools (https://github.com/apple/coremltools) will fix this issue. It has been dealt with in apple/coremltools@02ddf84 |
@dlawrences I can't find the document to build coremltools from the source. Can you give me the link? Otherwise, I need to wait coremltools new version release. |
Hi @imyoungyang There are some details here... You should do:
And then, you need to copy |
Hi
Could you please try installing the package from the build directory using *pip
install .*?
Make sure to uninstall if you have already installed it or use *pip install
--upgrade .*
Thanks
În mar., 21 iul. 2020 la 13:14, joshgreifer <notifications@github.com> a
scris:
… Hi @dlawrences <https://github.com/dlawrences> , following your
instructions above does not build (under Ubuntu 18.04) libcoremlpython.so,
but only builds libcaffeconverter.so, and does not resolve the issue for me.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#315 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AB3VVB24TQGEJXXY5Z36LI3R4VS6RANCNFSM4OSQTDXQ>
.
--
Co-Founder @ innaite.tech
Team Lead, Advanced Analytics @ softelligence.net
|
Thanks, I deleted my comment, but not before you replied - I copied the python code from the |
Great @joshgreifer |
Hi Everyone, Line 29 in 7eaf225
But the Coremltools throws an exception CoreML export failure: node 2321 (expand) got 3 input(s), expected 2 Without comment, it exports successfully but returns strange output, and it is unclear what to do with that output. Is there any way to keep the Detect layer and convert it to CoreML? Thanks. |
I've used some suggestions from here #343 and implemented the Detect layer's inference function as post-processing.
pred = model(img, augment=opt.augment) Hope this will help. |
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. |
I have the same problem when export to mlmodel, but could you tell me where to add these code? |
@hovhanns can you explain your solution a littler more. |
All these things are done because of Line 50 in 0ada058
In fact, our model output changes after exporting, and the above-mentioned post-processing is necessary to have the right output. |
Hi @hovhanns, what was your Vision request output after these changes, was it |
Hi @maidmehic, The output was bounding boxes and classes only(Objective-C based array), then we added some logic there to draw the boxes on the taken picture. |
@hovhanns do you have an example of how to run this in swift? |
@tylercollins590
Now just export the model and pass it to non_max_suppression function(that can be implemented in swift.) |
ONNX export success, saved as ./yolov5s.onnx
Starting CoreML export with coremltools 4.0b1...
WARNING:root:Tuple detected at graph output. This will be flattened in the converted model.
Converting Frontend ==> MIL Ops: 4%|▍ | 60/1415 [00:00<00:04, 303.59 ops/s]
CoreML export failure: PyTorch convert function for op leaky_relu_ not implemented
The text was updated successfully, but these errors were encountered: