PINTO0309 / OpenVINO-YoloV3

YoloV3/tiny-YoloV3+RaspberryPi3/Ubuntu LaptopPC+NCS/NCS2+USB Camera+Python+OpenVINO
https://qiita.com/PINTO
Apache License 2.0
538 stars 167 forks source link

Can't convert to bin and xml file? #40

Closed cuixing158 closed 5 years ago

cuixing158 commented 5 years ago

when i convert my yolov3.onnx to bin and xml file , i get a error? is it not supported? env: win10_x64, python3.7+pytorch1.1+onnx1.5+OpenVINO2019.1.148 cmd input: python mo.py --input_model yolov3.onnx "yolov3.onnx" come from here

Model Optimizer version: 2019.1.1-83-g28dfbfd [ ERROR ] Cannot pre-process ONNX graph after reading from model file "C:\Program Files (x86)\IntelSWTools\openvino_2019.1.148\deployment_tools\model_optimizer\yolov3.onnx". File is corrupt or has unsupported format. Details: Reference to y3:01 is not satisfied. A node refer not existing data tensor. ONNX model is not consistent. Protobuf fragment: input: "y3:01" output: "TFNodes/yolo_evaluation_layer_1/Shape_3:0" name: "TFNodes/yolo_evaluation_layer_1/Shape_3" op_type: "Shape" . For more information please refer to Model Optimizer FAQ (/deployment_tools/documentation/docs/MO_FAQ.html), question #44.

PINTO0309 commented 5 years ago

https://docs.openvinotoolkit.org/latest/_docs_MO_DG_prepare_model_convert_model_Convert_Model_From_ONNX.html

https://docs.openvinotoolkit.org/latest/_docs_MO_DG_prepare_model_convert_model_Converting_Model_General.html

https://docs.openvinotoolkit.org/latest/_docs_MO_DG_prepare_model_Supported_Frameworks_Layers.html#onnx_supported_operators_and_the_mapping_to_the_intermediate_representation_layers

sudo /opt/intel/openvino/deployment_tools/model_optimizer/mo_onnx.py \
--input_model ~/Downloads/yolov3.onnx \
--data_type FP32

Model Optimizer arguments:
Common parameters:
    - Path to the Input Model:  /home/xxxx/Downloads/yolov3.onnx
    - Path for generated IR:    /home/xxxx/.
    - IR output name:   yolov3
    - Log level:    ERROR
    - Batch:    Not specified, inherited from the model
    - Input layers:     Not specified, inherited from the model
    - Output layers:    Not specified, inherited from the model
    - Input shapes:     Not specified, inherited from the model
    - Mean values:  Not specified
    - Scale values:     Not specified
    - Scale factor:     Not specified
    - Precision of IR:  FP32
    - Enable fusing:    True
    - Enable grouped convolutions fusing:   True
    - Move mean values to preprocess section:   False
    - Reverse input channels:   False
ONNX specific parameters:
Model Optimizer version:    2019.1.0-341-gc9b66a2
[ ERROR ]  Unexpected exception happened during extracting attributes for node 723.
Original exception message: One/both of widths_scale = None and height_scale = None is not defined for Upsampe node 670.
cuixing158 commented 5 years ago

@PINTO0309 thanks give reply, so it can't convert to bin and xml file ,the reason is that unsupported Operators?

PINTO0309 commented 5 years ago

Yes. exactly. "OpenNINO" support for "ONNX" is very inadequate. I strongly recommend the use of Tensorflow or Caffe or Keras.

Aeroxander commented 5 years ago

I have the exact same issue. Sadly I started in PyTorch, and unable to convert the model to Tensorflow. (With the first model the conversion from ONNX to OpenVINO went fine)

Zanderzt commented 4 years ago

Yes. exactly. "OpenNINO" support for "ONNX" is very inadequate. I strongly recommend the use of Tensorflow or Caffe or Keras.

Hi,could you tell me how keras convert to bin & xml,is there have some documents? I had convert keras(.h5) to onnx,and i meet the same problom. Thank you very much!!

abpanchal95 commented 4 years ago

I can guide to convert your Keras model to bin and XML. First you need to convert your model from Keras to TensorFlow. You can find a script for that from a simple Google search if you don't just contact me. After converting you model to TensorFlow you will get model.pb you then need to give it to openvino and it will create .XML and .bin for you. If you need more detail and any specific step please comment. Thanks