A error when doing "import tvm" python

Hi, I have build from source and cant do import python.

Expected behavior

Install tvm

Actual behavior

I have successfully installed tvm before ,as follows

image

But when I used it today, I suddenly found that I couldn’t import tvm, as follows

Python 3.9.13 (main, Aug 25 2022, 23:26:10) [GCC 11.2.0] :: Anaconda, Inc. on linux Type “help”, “copyright”, “credits” or “license” for more information.

import tvm Traceback (most recent call last): File “”, line 1, in File “/home/user/tvm/python/tvm/init.py”, line 33, in from .runtime.object import Object File “/home/user/tvm/python/tvm/runtime/init.py”, line 22, in from .object_path import ObjectPath, ObjectPathPair File “/home/user/tvm/python/tvm/runtime/object_path.py”, line 42, in class ObjectPath(Object): File “/home/user/tvm/python/tvm/_ffi/registry.py”, line 69, in register check_call(_LIB.TVMObjectTypeKey2Index(c_str(object_name), ctypes.byref(tidx))) File “/home/user/tvm/python/tvm/_ffi/base.py”, line 348, in check_call raise get_last_ffi_error() tvm.ffi.base.TVMError: Traceback (most recent call last): [bt] (2) /home/user/Ascend/ascend-toolkit/latest/x86_64-linux/lib64/libtvm.so(TVMObjectTypeKey2Index+0x36) [0x7f1177801b16] [bt] (1) /home/user/Ascend/ascend-toolkit/latest/x86_64-linux/lib64/libtvm.so(tvm::runtime::Object::TypeKey2Index(std::string const&)+0x3e) [0x7f117780194e] [bt] (0) /home/user/Ascend/ascend-toolkit/latest/x86_64-linux/lib64/libtvm.so(tvm::runtime::TypeContext::TypeKey2Index(std::string const&)+0x3b7) [0x7f1177803e87] File “object.cc”, line 157 TVMError: [EB9000] Check failed: it != type_key2index.end(): Cannot find type ObjectPath. Did you forget to register the node by TVM_REGISTER_NODE_TYPE ?

And I have rebuilt tvm ,but it doesn’t work.

Environment

Any environment details, such as: Operating System, TVM version, etc Operating System:Ubuntu20.04 GCC:11.2.0 TVM:0.10.dev0 (trying) 0.09.dev0(before) llvm:13.0.0

This is a problem due to wrong TVM_LIBRARY_PATH.And I added export the environment variable TVM_LIBRARY_PATH=$TVM_PATH/build.It works now.

1 Like