tvm
tvm copied to clipboard
[frontend][onnx]fix pad constant value is none
hi, cc @AndrewZhaoLuo
When I import my onnx model. I found my model get a error with pad. because the pad constant value is none. shown as follow:
It`s just a very little bug. So I fix it and no unnit test.
Dose this PR need to be reviewed again? @AndrewZhaoLuo @leandron
Dose this PR need to be reviewed again? @AndrewZhaoLuo @leandron
Yeah I'll leave it to Leandron B)
I am sorry, I really can't create an unit test with empty string of constant_value.
@leandron @AndrewZhaoLuo
I am sorry, I really can't create an unit test with empty string of
constant_value. @leandron @AndrewZhaoLuo
In verify_pad_v11 I can seem to make the following:
graph = helper.make_graph(
[node],
"pad_test",
inputs=[
helper.make_tensor_value_info("input", TensorProto.FLOAT, list(indata.shape)),
helper.make_tensor_value_info("pads", TensorProto.INT64, (len(pads),)),
helper.make_tensor_value_info("constant_value", TensorProto.STRING, (1,)),
],
initializer=[
helper.make_tensor("pads", TensorProto.INT64, (len(pads),), pads),
helper.make_tensor("constant_value", TensorProto.STRING, (1,), [b""]),
],
outputs=[
helper.make_tensor_value_info("output", TensorProto.FLOAT, list(outdata.shape))
],
)
However, my version of ONNXRT can't seem to accept the string type. What have you tried?
@AndrewZhaoLuo Yes, I tried many times but I got the same error as yours.
onnxruntime.capi.onnxruntime_pybind11_state.InvalidGraph: [ONNXRuntimeError] : 10 : INVALID_GRAPH : This is an invalid model. Type Error: Type 'tensor(string)' of input parameter (constant_value) of operator (Pad) in node () is invalid.
Can you share your model by any chance? Can you also run your model via ONNX-RT?
Can you share your model by any chance? Can you also run your model via ONNX-RT?
- model have been uploaded.
- The model can pass by ONNX-RT. And the floating point comparison between tvm and onnx-RT result can also pass.
Sorry, I'll take a look tomorrow.
Edit: On Friday
Hey, @AndrewZhaoLuo Have you seen this PR, and any update with me? thanks.
Oops, I am so sorry, I have been very busy lately. I will try to get to this this weekend