-
-
Notifications
You must be signed in to change notification settings - Fork 15.9k
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
Can not export to edgetpu model #8842
Comments
👋 Hello @walterwangimagr, thank you for your interest in YOLOv5 🚀! Please visit our ⭐️ Tutorials to get started, where you can find quickstart guides for simple tasks like Custom Data Training all the way to advanced concepts like Hyperparameter Evolution. 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 training ❓ Question, please provide as much information as possible, including dataset images, training logs, screenshots, and a public link to online W&B logging if available. For business inquiries or professional support requests please visit https://ultralytics.com or email support@ultralytics.com. RequirementsPython>=3.7.0 with all requirements.txt installed including PyTorch>=1.7. To get started: git clone https://github.com/ultralytics/yolov5 # clone
cd yolov5
pip install -r requirements.txt # install EnvironmentsYOLOv5 may be run in any of the following up-to-date verified environments (with all dependencies including CUDA/CUDNN, Python and PyTorch preinstalled):
StatusIf this badge is green, all YOLOv5 GitHub Actions Continuous Integration (CI) tests are currently passing. CI tests verify correct operation of YOLOv5 training (train.py), validation (val.py), inference (detect.py) and export (export.py) on macOS, Windows, and Ubuntu every 24 hours and on every commit. |
@walterwangimagr thanks for the bug report! I'll try to reproduce using your commands. |
@walterwangimagr yes I'm able to reproduce. Very strange, not sure what the problem might be.
VOC (20cls) also fails. Edge TPU seems to be failing for all non-80 class datasets. Perhaps 80 is hardcoded somewhere in the conversion process. I'll investigate tomorrow.
|
@zldrobit I might need some advice here. Edge TPU export is failing for non-COCO models. I'm not sure what the cause is. Export works for coco128 but fails for VOC and GlobalWheat2020 trained models (see above). TFLite int-8 export works correctly for both prior to Edge TPU failure. What do you think? |
@glenn-jocher I could confirm that using the default setting ( |
I had look at some posts on |
@walterwangimagr class names are embedded as model attributes after training finishes, i.e. @zldrobit ok thanks for the results! Do you think we should update Edge TPU export to |
@zldrobit I don't think we can use the -i argument as we don't know the output layer names ahead of time for the different sized models. I tested |
@walterwangimagr good news 😃! Your original issue may now be fixed ✅ in PR #8902 by adding a --search-delegate argument to Edge TPU model compilation per @zldrobit's solution above. To receive this update:
Thank you for spotting this issue and informing us of the problem. Please let us know if this update resolves the issue for you, and feel free to inform us of any other issues you discover or feature requests that come to mind. Happy trainings with YOLOv5 🚀! |
Thank you very much |
@walterwangimagr you're welcome! If you need further assistance or have other questions, feel free to ask. Happy to help! |
Search before asking
YOLOv5 Component
Export
Bug
I was following the tutorial to train a model and export to edgetpu model.
When I use the coco128.yaml as dataset, it was fine I can train and export
But when I use a custom dataset with only one class, it fail on the step tflite -> edgetpu
I also try with the similar dataset GlobalWheat2020.yaml, same issue. Is there an extra step I need to do or it is a bug?
I use the docker image provided and install tensorflow 2.9.1 for export
Training script
python train.py --img 640 --batch 16 --epochs 3 --data coco128.yaml --weights yolov5s.pt --name coco128
Export script
python export.py --img 640 --data data/coco128.yaml --weights runs/train/coco128/weights/best.pt --include edgetpu
And this work fine
Training script
python train.py --img 640 --batch 16 --epochs 3 --data GlobalWheat2020.yaml --weights yolov5s.pt
Export script
python export.py --img 640 --data data/GlobalWheat2020.yaml --weights runs/train/exp19/weights/best.pt --include edgetpu
Run into error
Environment
-Docker images provided
-install tensorflow 2.9.1
Minimal Reproducible Example
Additional
No response
Are you willing to submit a PR?
The text was updated successfully, but these errors were encountered: