-
-
Notifications
You must be signed in to change notification settings - Fork 16.3k
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
fix tf
conversion in new v6 models
#5153
Conversation
tf
conversion in new v6 (#5147)tf
conversion in new v6 models
@YoniChechik PR is merged. Thank you for your contributions to YOLOv5 π and Vision AI β |
When I am exporting a custom trained model into tflite and then loading it , I am getting the following error: |
@rahuja23 π hi, thanks for letting us know about this possible problem with YOLOv5 π. We've created a few short guidelines below to help users provide what we need in order to get started investigating a possible problem. How to create a Minimal, Reproducible ExampleWhen asking a question, people will be better able to provide help if you provide code that they can easily understand and use to reproduce the problem. This is referred to by community members as creating a minimum reproducible example. Your code that reproduces the problem should be:
In addition to the above requirements, for Ultralytics to provide assistance your code should be:
If you believe your problem meets all of the above criteria, please close this issue and raise a new one using the π Bug Report template and providing a minimum reproducible example to help us better understand and diagnose your problem. Thank you! π |
torch - 1.9.1 |
@rahuja23 your error is not reproducible. Training and export to TFLite operates correctly. # Train YOLOv5s on COCO128 for 3 epochs
!python train.py --img 640 --batch 16 --epochs 3 --data coco128.yaml --weights yolov5s.pt --cache
# Export to TFLite, SUCCESS
!python export.py --weights runs/train/exp/weights/best.pt --include tflite How to create a Minimal, Reproducible ExampleWhen asking a question, people will be better able to provide help if you provide code that they can easily understand and use to reproduce the problem. This is referred to by community members as creating a minimum reproducible example. Your code that reproduces the problem should be:
In addition to the above requirements, for Ultralytics to provide assistance your code should be:
If you believe your problem meets all of the above criteria, please close this issue and raise a new one using the π Bug Report template and providing a minimum reproducible example to help us better understand and diagnose your problem. Thank you! π |
Ok I figured it out I was setting the device parameter in export file as well to CUDA, if we leave it to default it works. Thanks for the new push guys ππ» |
* fix `tf` conversion in new v6 (ultralytics#5147) * sort imports Co-authored-by: Glenn Jocher <[email protected]>
π οΈ PR Summary
Made with β€οΈ by Ultralytics Actions
π Summary
Integration of TFSPPF, a new TensorFlow spatial pyramid pooling-fast layer, into the YOLOv5 architecture.
π Key Changes
TFSPPF
class to the TensorFlow model file, providing a new layer for spatial pyramid pooling with a fast implementation.parse_model
function to include the newSPPF
layer when constructing models.models.tf.py
to include the newly addedSPPF
alongside other common model components.π― Purpose & Impact
TFSPPF
layer is designed to improve model performance by providing a more efficient way to handle spatial data.