You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@tvm.apache.org by GitBox <gi...@apache.org> on 2020/04/21 12:54:44 UTC
[GitHub] [incubator-tvm] gopinath-r commented on issue #5133: [Torch] A list of missing op conversion in need of help
gopinath-r commented on issue #5133:
URL: https://github.com/apache/incubator-tvm/issues/5133#issuecomment-617160891
@masahi I am trying to use tvm for the following model
[https://github.com/cogaplex-bts/bts/blob/master/pytorch/bts.py]
I am getting the following error while building the relay IR from pytorch scripted model
**TypeError: Don't know how to handle type <class 'torch.Tensor'>**
After debugging i found that error is thrown at parsing the operation torch.repeat.
and torch.repeat is mapped as aten::repeat in _tvm/python/tvm/relay/frontend/pytorch.py_
torch.repeat operates on tensor but while parsing torch.repeat it is unable to handle the data type
following is the complete error trace
`<ipython-input-10-3be1ae989a55> in <module>
1 shape_list = [('input0', (1,3,1216,352))]
2 mod, params = relay.frontend.from_pytorch(scripted_model,
----> 3 shape_list)
~/Documents/Projects/Kyocera_depth_estimation/optimization/tvm/python/tvm/relay/frontend/pytorch.py in from_pytorch(script_module, input_shapes, custom_convert_map)
2255
2256 ret = convert_operators(_get_operator_nodes(graph.nodes()),
-> 2257 outputs, ret_name, convert_map, prelude)
2258
2259 mod["main"] = tvm.relay.Function(_analysis.free_vars(ret[0]), ret[0])
~/Documents/Projects/Kyocera_depth_estimation/optimization/tvm/python/tvm/relay/frontend/pytorch.py in convert_operators(operators, outputs, ret_names, convert_map, prelude)
2169 relay_op = convert_map[operator]
2170 # print("relay_op",relay_op)
-> 2171 relay_out = relay_op(inputs, _get_input_types(op_node))
2172
2173 if isinstance(relay_out, tuple):
~/Documents/Projects/Kyocera_depth_estimation/optimization/tvm/python/tvm/relay/frontend/pytorch.py in _impl(inputs, input_types)
322 # print("data",data)
323 # print("reps",reps)
--> 324 return _op.transform.tile(data, reps=reps)
325 return _impl
326
~/Documents/Projects/Kyocera_depth_estimation/optimization/tvm/python/tvm/relay/op/transform.py in tile(data, reps)
446 """
447
--> 448 return _make.tile(data, reps)
449
450
~/Documents/Projects/Kyocera_depth_estimation/optimization/tvm/python/tvm/_ffi/_ctypes/packed_func.py in __call__(self, *args)
209 """
210 temp_args = []
--> 211 values, tcodes, num_args = _make_tvm_args(args, temp_args)
212 ret_val = TVMValue()
213 ret_tcode = ctypes.c_int()
~/Documents/Projects/Kyocera_depth_estimation/optimization/tvm/python/tvm/_ffi/_ctypes/packed_func.py in _make_tvm_args(args, temp_args)
175 else:
176 print(arg)
--> 177 raise TypeError("Don't know how to handle type %s" % type(arg))
178 return values, type_codes, num_args
179
TypeError: Don't know how to handle type <class 'torch.Tensor'>`
If you know what is the reason and how to resolve this it would be really helpful
Thanks in advance
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org