Closed YuriyPryyma closed 4 years ago
I am also facing the same issue
code:
torch.onnx.export(model, input, "onnx_espnet_v2_s2_384.onnx")
File "/home/guru/anaconda3/envs/EdgeNets/lib/python3.7/site-packages/torch/onnx/symbolic_helper.py", line 75, in _parse_arg raise RuntimeError("Failed to export an ONNX attribute, " RuntimeError: Failed to export an ONNX attribute, since it's not constant, please try to make things (e.g., kernel size) static if possible
Any update on this??
Onnx conversion requires static graph. You need to remove any conditions, variables, etc that are not static. For example, checking input and output size using if-else condition to create residual connection.
Also, there are compatibility issues between onnx and PyTorch, so you need to fix all those issues too.
I`m exporting to onnx and got error "upsample_bilinear2d" If try to fix it as mentioned in this issue After that I got "upsample_bilinear2d because align_corners == True not supported" when i change align_corners == True to False I got "RuntimeError: Failed to export an ONNX attribute, since it's not constant, please try to make things (e.g., kernel size) static if possible"