I have recently installed TVM from git (July 2020) in Ubuntu 18.04 with LLVM 6.0.0, cmake 3.10.2, python 3.6.9. And I am getting the following errors when trying to execute the Tutorial on Compile PyTorch Models:
- From he code without any modification:
File "from_pytorch.py", line 113, in <module>
m = graph_runtime.GraphModule(lib['default'](ctx))
TypeError: tuple indices must be integers or slices, not str
As “lib” is obtained from
with tvm.transform.PassContext(opt_level=3):
lib = relay.build(mod, target=target, target_host=target_host, params=params)
relay.build()
returns 3 outputs ( graph_json ( str ), mod ( tvm.Module ), params ( dict ) ). And tvm.contrib.graph_runtime.
GraphModule()
expect as input module ( tvm.runtime.Module ). I tried to replace the line obtaining “lib” by:
graph_json, libmod, params = relay.build(mod, target=target, target_host=target_host, params=params)
And using “libmod” instead of “lib” in the line that generates the error.
- It generates the following error:
AttributeError: Module has no function 'default'
- By removing the
['default']
:
m = graph_runtime.GraphModule(libmod(ctx))
TVMError: Check failed: entry_name != nullptr: Symbol __tvm_main__ is not presented
- By using the original “lib” and replacing
'default'
by1
inside the brackets I get the same error.
I am out of ideas on how to solve the problem. Does any one knows the source of the error or have any ideas on how to sole or workaround it?
Thanks.