microsoft / Windows-Machine-Learning

Samples and Tools for Windows ML.
https://docs.microsoft.com/en-us/windows/ai/
MIT License
1.03k stars 446 forks source link

Inference Time Error ([ONNXRuntimeError] : 10 : INVALID_GRAPH ) #275

Closed jaemjaem closed 4 years ago

jaemjaem commented 5 years ago

from winmltools.utils import convert_float_to_float16 from winmltools.utils import load_model, save_model

onnx_model = load_model('InputModel.onnx') new_onnx_model = convert_float_to_float16(onnx_model) save_model(new_onnx_model, 'OuputModel_fp16.onnx')

sess = rt.InferenceSession('InputModel_fp16.onnx')

RuntimeError: [ONNXRuntimeError] : 10 : INVALID_GRAPH : Load model from new_yolo3_one_dimension.onnx failed:This is an invalid model. Type Error: Type 'tensor(float16)' of input parameter (Resize_scales) of operator (Resize) in node (Resize) is invalid.

I converted the onnx model to float 16 using winmltools.

At the reference time, there is an RuntimeError. How do I fix it??

martinb35 commented 4 years ago

@jaemjaem - if you are still having this issue, can you please post in the onnxruntime github issues section? That is where evaluation issues get tracked. Thanks!