Open youwh-PIRI opened 4 years ago
@youwh-PIRI Sorry for not familiar with onnxruntime.
yes.
when I try to use onnx-simplifier. The same error occurred.
looks like onnx checker can not accept current model format.
################
python -m onnxsim efficientdet-d1.onnx efficientdet-d1-opt.onnx
Simplifying...
Traceback (most recent call last):
File "/opt/anaconda3/lib/python3.6/runpy.py", line 193, in _run_module_as_main
"main", mod_spec)
File "/opt/anaconda3/lib/python3.6/runpy.py", line 85, in _run_code
exec(code, run_globals)
File "/opt/anaconda3/lib/python3.6/site-packages/onnxsim/main.py", line 48, in
==> Context: Bad node spec: input: "data" output: "1005" op_type: "Pad" attribute { name: "mode" s: "constant" type: STRING } attribute { name: "pads" ints: 0 ints: 0 ints: 0 ints: 0 ints: 0 ints: 0 ints: 1 ints: 1 type: INTS } attribute { name: "value" f: 0 type: FLOAT }
I also came across with the "Invalid Feed" error, here is my solution, before testing with onnxruntime_test, I use onnx optimize the onnx model, after "eliminate_unused_initializer" optimization, the onnxruntime_test passed. Hope this solution is usefull for you.
import onnx
from onnx import optimizer
def opt(original_model):
op = ["eliminate_unused_initializer"]
optimized_model = optimizer.optimize(original_model, op)
onnx.save(optimized_model, "efficientdet-d0-opt.onnx")
Hello, this error occurred when I was reasoning on onnxruntime. Have you ever encountered it?Thank you very much if you can reply!
onnxruntime.capi.onnxruntime_pybind11_state.InvalidGraph: [ONNXRuntimeError] : 10 : INVALID_GRAPH : Load model from /home/youwh/ywh/efficientDet--ONNX/convert/efficientdet-d1-voc.onnx failed:This is an invalid model. Error in Node: : Node () has input size 1 not in range [min=2, max=3].