Help! Cannot find type relay.attrs.ShapeOfAttrs. Please help me! Thanks!

When I run “import tvm”, it throw a error : "Cannot find type relay.attrs.ShapeOfAttrs. Did you forget to register the node by TVM_REGISTER_NODE_TYPE? " image

Usually when I get an error like this it’s because my TVM installation is messed up. Usually because I didn’t build after making some changes or if my paths were messed up.

Are you doing a dev. install of TVM?

1 Like

Yes, I am doing some work about AI chip’s compiler, it need to use TVM. I installed it according to the online tutorial, and I didn’t making some other changes in total process. “make -j4” installation reachs 100%. So I don’t know what I did wrong when I installed TVM. What do you mean “my paths were messed up”? What’s path you mean? Than you for you reply. (This is the online tutorial which I consult: TVM安装踩坑笔记_justsolow的博客-CSDN博客)

At present, I just use TVM. I don’t need to develop it. Maybe it will in future.

By path I mean python paths and such, e.g. where python looks for stuff to import.

I personally recommend installing from source, Install from Source — tvm 0.8.dev0 documentation it’s not that hard and is easier to debug I think. Use method 1 for the python package installation.

1 Like

I also encountered such issue, and found it is a bug. I guess it may related to gcc version. vm.shape_of will set_attrs_type_key(“relay.attrs.ShapeOfAtrrs”) when vm.shape_of is registered, and shapeOfAtrrs is registered later.

1 Like

I installed it successfully,thank you.you’re so brilliant.

Thank you. I have installed it successfully. I upgraded my operating system to Ubuntu 18.04 and reinstalled it. I think there is one thing to pay attention to. Associate TVM with the python you use, not with the system python. You may need to enter the Conda environment to install TVM.

1 Like

Ah yes, this is just good general advice and has caused me headaches with TVM and other libraries. Glad you got it fixed!