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

Export.py need train mode export for cormel model to add NMS and decode layer #9667

Closed
2 tasks done
junmcenroe opened this issue Oct 1, 2022 · 4 comments
Closed
2 tasks done
Labels
bug Something isn't working Stale Stale and schedule for closing soon

Comments

@junmcenroe
Copy link

junmcenroe commented Oct 1, 2022

Search before asking

  • I have searched the YOLOv5 issues and found no similar bug report.

YOLOv5 Component

Export

Bug

I had had been converted with export.py with -train mode to convert cormel model. after exported .mlmodel, I added decode layer and NMS. But after eliminate -train mode of export.py, I found the following error.


/usr/local/lib/python3.7/dist-packages/coremltools/models/neural_network/builder.py in set_output(self, output_names, output_dims)
529 spec = self.spec
530 for idx, dim in enumerate(output_dims):
--> 531 spec.description.output[idx].type.multiArrayType.ClearField("shape")
532 spec.description.output[idx].type.multiArrayType.shape.extend(dim)
533 spec.description.output[

IndexError: list index (1) out of range


Exported model shape with -train model and eval mode are different. So I modify the export.py with train mode, no failure found.
On "Remove .train() mode exports #9429", this train() mode removed. but Could you add train() mode to export.py ?

Environment

Google Colab

Minimal Reproducible Example

No response

Additional

No response

Are you willing to submit a PR?

  • Yes I'd like to help by submitting a PR!
@github-actions
Copy link
Contributor

github-actions bot commented Nov 1, 2022

👋 Hello, this issue has been automatically marked as stale because it has not had recent activity. Please note it will be closed if no further activity occurs.

Access additional YOLOv5 🚀 resources:

Access additional Ultralytics ⚡ resources:

Feel free to inform us of any other issues you discover or feature requests that come to mind in the future. Pull Requests (PRs) are also always welcomed!

Thank you for your contributions to YOLOv5 🚀 and Vision AI ⭐!

@github-actions github-actions bot added the Stale Stale and schedule for closing soon label Nov 1, 2022
@github-actions github-actions bot closed this as not planned Won't fix, can't repro, duplicate, stale Nov 12, 2022
@glenn-jocher
Copy link
Member

@junmcenroe hi there! Thanks for reaching out. It's great to see your interest in improving the export process. 😊

To clarify, the removal of .train() mode from export.py was intentional, as it wasn't used during inference and was causing inconsistencies in the exported models.

To address your requirement for the decode layer and NMS, you can customize your model by modifying the YOLO layer directly in the model.yaml configuration file before exporting. By doing this, you can include the desired layers without the need for the -train mode.

For more information, you can refer to our documentation at https://docs.ultralytics.com/yolov5/ for additional guidance on customizing the export process.

I appreciate your willingness to submit a PR! If you have any further questions or need assistance while working on the PR, feel free to reach out. We're here to help!

@junmcenroe
Copy link
Author

Hi glenn-josher

Thanks for your supplement comment. As of today, your original export.py can export cormel formats with NMS. So no issue for me.
You and your teams' great continuous work save us.

@glenn-jocher
Copy link
Member

@junmcenroe thank you for your kind words! The YOLO community and the Ultralytics team have indeed put in a lot of effort to enhance the YOLOv5 repository and we're glad to hear that our work has been helpful to you. If you have any further questions or need support in the future, please don't hesitate to reach out. Your feedback and contributions are highly valued. Keep up the great work, and happy coding!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working Stale Stale and schedule for closing soon
Projects
None yet
Development

No branches or pull requests

2 participants