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 .pt to .onnx with half precision failure. #8519

Closed
1 of 2 tasks
1chimaruGin opened this issue Jul 8, 2022 · 3 comments · Fixed by #8522
Closed
1 of 2 tasks

Export .pt to .onnx with half precision failure. #8519

1chimaruGin opened this issue Jul 8, 2022 · 3 comments · Fixed by #8522
Labels
bug Something isn't working

Comments

@1chimaruGin
Copy link

1chimaruGin commented Jul 8, 2022

Search before asking

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

YOLOv5 Component

No response

Bug

Command used to export:
python export.py --weights yolov5s.pt --include openvino --half

Error

export: data=data/coco128.yaml, weights=['yolov5s.pt'], imgsz=[640, 640], batch_size=1, device=cpu, half=True, inplace=False, train=False, keras=False, optimize=False, int8=False, dynamic=False, simplify=False, opset=12, verbose=False, workspace=4, nms=False, agnostic_nms=False, topk_per_class=100, topk_all=100, iou_thres=0.45, conf_thres=0.25, include=['openvino']
YOLOv5 🚀 v6.1-287-g63ba0cb Python-3.9.12 torch-1.10.0 CPU

Fusing layers... 
YOLOv5s summary: 213 layers, 7225885 parameters, 0 gradients, 16.5 GFLOPs

PyTorch: starting from yolov5s.pt with output shape (1, 25200, 85) (14.1 MB)

ONNX: starting export with onnx 1.11.0...
ONNX: export failure: "unfolded2d_copy" not implemented for 'Half'

OpenVINO: starting export with openvino 2022.1.0-7019-cdb9bec7210-releases/2022/1...
[ ERROR ]  The "yolov5s.onnx" is not existing file or directory

OpenVINO: export failure: Command '['mo', '--input_model', 'yolov5s.onnx', '--output_dir', 'yolov5s_openvino_model/', '--data_type', 'FP16']' returned non-zero exit status 1.

Environment

OS: ubuntu 20.04
Python: 3.9
Pytorch: 1.10

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!
@1chimaruGin 1chimaruGin added the bug Something isn't working label Jul 8, 2022
@github-actions
Copy link
Contributor

github-actions bot commented Jul 8, 2022

👋 Hello @1chimaruGin, 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.

Requirements

Python>=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

Environments

YOLOv5 may be run in any of the following up-to-date verified environments (with all dependencies including CUDA/CUDNN, Python and PyTorch preinstalled):

Status

CI CPU testing

If 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.

@glenn-jocher
Copy link
Member

@1chimaruGin --half exports usually require a GPU, i.e. --half --device 0:

!python export.py --weights yolov5s.pt --include openvino --half --device 0

Screen Shot 2022-07-08 at 1 21 46 PM

But be aware that OpenVINO inference is only supported on CPU currently, and I'm not sure if --half inference will work there. Let me know what happens!

glenn-jocher added a commit that referenced this issue Jul 8, 2022
Improved error reporting for #8519
@glenn-jocher glenn-jocher linked a pull request Jul 8, 2022 that will close this issue
glenn-jocher added a commit that referenced this issue Jul 8, 2022
Improved error reporting for #8519
@glenn-jocher
Copy link
Member

@1chimaruGin I've improved error reporting for this use case in #8522 so users will now get a message to repeat --half exports on a GPU, i.e. with --device 0

Shivvrat pushed a commit to Shivvrat/epic-yolov5 that referenced this issue Jul 12, 2022
ctjanuhowski pushed a commit to ctjanuhowski/yolov5 that referenced this issue Sep 8, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants