Closed luyaor closed 3 years ago
[Bug] [Relay] Error when compiling a simple ONNX model
When compiling following model with TVM, it will error.
The model(with ONNX as frontend) with error is as follows, check bug.onnx in bug5.zip.
I think it is because ONNX allows attribute alpha in LeakyRelu with a default value 0.01. Please check LpPool in ONNX: https://github.com/onnx/onnx/blob/master/docs/Operators.md#leakyrelu
alpha
Traceback (most recent call last): File "check.py", line 11, in <module> mod, params = relay.frontend.from_onnx(onnx_model, {}) File "/Users/luyaor/Documents/tvm/python/tvm/relay/frontend/onnx.py", line 2806, in from_onnx mod, params = g.from_onnx(graph, opset, freeze_params) File "/Users/luyaor/Documents/tvm/python/tvm/relay/frontend/onnx.py", line 2613, in from_onnx op = self._convert_operator(op_name, inputs, attr, opset) File "/Users/luyaor/Documents/tvm/python/tvm/relay/frontend/onnx.py", line 2721, in _convert_operator sym = convert_map[op_name](inputs, attrs, self._params) File "/Users/luyaor/Documents/tvm/python/tvm/relay/frontend/common.py", line 603, in __call__ return get_relay_op(self._new_name)(*inputs, **attrs) TypeError: leaky_relu() missing 1 required positional argument: 'alpha'
Python3, with tvm, onnx
tvm version: c31e338 Wed Dec 9 14:52:58 2020 +0900
c31e338
python check.py
Fixed in #7259.
[Bug] [Relay] Error when compiling a simple ONNX model
Description
When compiling following model with TVM, it will error.
The model(with ONNX as frontend) with error is as follows, check bug.onnx in bug5.zip.![image](https://user-images.githubusercontent.com/7541296/104155892-1225fc80-5423-11eb-9e6b-2a0b8a90a017.png)
I think it is because ONNX allows attribute
alpha
in LeakyRelu with a default value 0.01. Please check LpPool in ONNX: https://github.com/onnx/onnx/blob/master/docs/Operators.md#leakyreluError Log
How to reproduce
Environment
Python3, with tvm, onnx
tvm version:
c31e338
Wed Dec 9 14:52:58 2020 +0900python check.py
.