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

Update ci-testing.yml #5151

Closed
wants to merge 2 commits into from
Closed

Update ci-testing.yml #5151

wants to merge 2 commits into from

Conversation

YoniChechik
Copy link
Contributor

@YoniChechik YoniChechik commented Oct 12, 2021

add testing to saved_model and tflite conversion

πŸ› οΈ PR Summary

Made with ❀️ by Ultralytics Actions

🌟 Summary

Enhanced export compatibility for YOLOv5 models in TensorFlow formats.

πŸ“Š Key Changes

  • Added a new line in the CI (Continuous Integration) testing workflow to export YOLOv5 models to TensorFlow's saved_model and tflite formats.

🎯 Purpose & Impact

  • 🎨 Purpose: This change ensures that automated tests now include the process of converting YOLOv5 models to additional TensorFlow formats, increasing the compatibility and usability of YOLOv5 in TensorFlow-based environments.
  • βœ… Impact: Users benefit from enhanced support for model deployment across diverse platforms, which now includes TensorFlow Lite for mobile and IoT devices, broadening YOLOv5's applicability.

add testing to saved_model and tflite conversion
Copy link
Contributor

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

πŸ‘‹ Hello @YoniChechik, thank you for submitting a πŸš€ PR! To allow your work to be integrated as seamlessly as possible, we advise you to:

  • βœ… Verify your PR is up-to-date with origin/master. If your PR is behind origin/master an automatic GitHub actions rebase may be attempted by including the /rebase command in a comment body, or by running the following code, replacing 'feature' with the name of your local branch:
git remote add upstream https://github.com/ultralytics/yolov5.git
git fetch upstream
git checkout feature  # <----- replace 'feature' with local branch name
git merge upstream/master
git push -u origin -f
  • βœ… Verify all Continuous Integration (CI) checks are passing.
  • βœ… Reduce changes to the absolute minimum required for your bug fix or feature addition. "It is not daily increase but daily decrease, hack away the unessential. The closer to the source, the less wastage there is." -Bruce Lee

@YoniChechik
Copy link
Contributor Author

Currently this fix is failing due to this bug: #5147

@YoniChechik
Copy link
Contributor Author

Once #5153 is merged, the errors above will be eliminated.

@glenn-jocher
Copy link
Member

glenn-jocher commented Oct 12, 2021

@YoniChechik thanks for the PR!

That's too bad that the CI checks did not catch the TF model issue with the SPPF layer, but I think the existing CI should suffice since it actually builds a new TF and Keras model already with this line.

python models/yolo.py --cfg ${{ matrix.model }}.yaml # build PyTorch model
python models/tf.py --weights ${{ matrix.model }}.pt # build TensorFlow model

I'm a little confused about why the CI checks didn't report an error here, but I think the source of the problem was that it was loading models from the latest release, which at the time was v5.0. Since tf.py builds models from a *.pt file's internal yaml rather than directly from a yaml, it was pulling the v5.0 models and building them, and everything worked correctly there already of course.

So I think this PR may be unnecessary other than to evaluate full TFLite export. The reason we don't use TFLite export in the CI is that it is much slower than all the other tests, roughly doubling the CI check time when we earlier looked at this option.

@glenn-jocher
Copy link
Member

/rebase

@YoniChechik
Copy link
Contributor Author

I understand. I've also figured this download v5 part while debugging. In this case I'll close this PR.

@glenn-jocher
Copy link
Member

One possible solution might be to load the trained model instead of the official model. The trained model is built from the --cfg *.yaml:

          # Export
          python models/yolo.py --cfg ${{ matrix.model }}.yaml  # build PyTorch model
          python models/tf.py --weights runs/train/exp/weights/last.pt  # build TensorFlow model
``

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

Successfully merging this pull request may close these issues.

2 participants