Errors in Tutorial Compile PyTorch Models

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:

  1. From he code without any modification:

File "", 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 =, target=target, target_host=target_host, params=params) 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 =, target=target, target_host=target_host, params=params)

And using “libmod” instead of “lib” in the line that generates the error.

  1. It generates the following error:

AttributeError: Module has no function 'default'

  1. By removing the ['default']:

m = graph_runtime.GraphModule(libmod(ctx))

TVMError: Check failed: entry_name != nullptr: Symbol __tvm_main__ is not presented

  1. By using the original “lib” and replacing 'default' by 1 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?


Please install the latest source code of tvm. We have implemented new model based graph runtime recently.

Thanks, I have re-installed TVM and now it is working. Although I got the previous version from a few weeks ago, and before uninstalling it I checked its version “0.7.dev1”. The new one that I have installed today (22 July 2020) it is still the same version “0.7.dev1”.

This changeset is introduced into TVM recent days.