Compile onnx model error in pytorch 1.1.0


#1

I use pytorch 1.1.0 and covert the model to onnx. Then I use tvm to compile onnx model, I found this error:


And I add some debug info, I found the op “unsample” cause the " AttributeError: ‘<class ‘tvm.relay.expr.Call’>’ object has no attribute ‘name_hint’"

debug: Floor
debug: Unsqueeze
debug: Unsqueeze
debug: Concat
debug: Cast
debug: Shape
debug: Slice
WARNING:root:Attribute axes is ignored in relay.sym.strided_slice
debug: Cast
debug: Div
debug: Concat
debug: Upsample
Traceback (most recent call last):
  File "build_onnx.py", line 12, in <module>
    mod, params = relay.frontend.from_onnx(onnx_model, shape_dict)
  File "/home/removebg/mscoco/code/tvm/python/tvm/relay/frontend/onnx.py", line 1264, in from_onnx
    mod, params = g.from_onnx(graph, opset)
  File "/home/removebg/mscoco/code/tvm/python/tvm/relay/frontend/onnx.py", line 1092, in from_onnx
    op = self._convert_operator(op_name, inputs, attr, opset)
  File "/home/removebg/mscoco/code/tvm/python/tvm/relay/frontend/onnx.py", line 1198, in _convert_operator
    sym = convert_map[op_name](inputs, attrs, self._params)
  File "/home/removebg/mscoco/code/tvm/python/tvm/relay/frontend/onnx.py", line 557, in _impl_v9
    scales = params[inputs[1].name_hint].asnumpy()
  File "/home/removebg/mscoco/code/tvm/python/tvm/_ffi/_ctypes/node.py", line 75, in __getattr__
    "'%s' object has no attribute '%s'" % (str(type(self)), name))
AttributeError: '<class 'tvm.relay.expr.Call'>' object has no attribute 'name_hint'

#2

I Solve it, It’s pytorch 1.1.0 bug, reinstall pytorch 1.0.1 solve it。


#3

Hi,I meet the same problem.But it can not solve by using pytorch 1.0.1. Any suggestions?Looking forward your reply!


#4

@burness What is your version of tvm?Do you try pytorch1.2 or nightly?