ultralytics / yolov3

YOLOv3 in PyTorch > ONNX > CoreML > TFLite
https://docs.ultralytics.com
GNU Affero General Public License v3.0
10.18k stars 3.44k forks source link

Check ONNX Model Error #1034

Closed lxgyChen closed 4 years ago

lxgyChen commented 4 years ago

Thanks for works, but I'm having a problem export pt model to onnx.

  1. My envirenment: ubuntu LTS 18-04, pytorch 1.4, python is 3.7
  2. In models.py, I set ONNX_EXPORT = True
  3. python detect.py --cfg cfg/yolov3.cfg --names data/coco.names --weights weights/yolov3.pt Error occurred: Segmentation fault (core dumped) in detect.py line 53: onnx.checker.check_model(model)

The yolov3.pt is download from https://drive.google.com/open?id=1LezFG5g3BCW6iYaV89B2i64cqEUZD7e0.

But if I use the yolov3.onnx that you provided, I sucessfully convert ONNX model to MNN [https://github.com/alibaba/MNN] model

github-actions[bot] commented 4 years ago

Hello @lxgyChen, thank you for your interest in our work! Please visit our Custom Training Tutorial to get started, and see our Google Colab Notebook, Docker Image, and GCP Quickstart Guide for example environments.

If this is a bug report, please provide screenshots and minimum viable code to reproduce your issue, otherwise we can not help you.

glenn-jocher commented 4 years ago

Ah that’s odd. That should work correctly to export to onnx. In any case, yolov3.onnx should work for you.

You might also try a working environment, such as the colab notebook mentioned above, as we’ve verified everything works in this environment.

lxgyChen commented 4 years ago

oh,it's weird that when I create a new script to verify the converted onnx file, the error disappear.

glenn-jocher commented 4 years ago

Ok. Yes its not reproducible for us either.