[TVM/VTA] "Attribute FTVMCompute has not been registered for Operator tvm_op"


I’m new to TVM and I’m trying to compile a ResNet-50 model and running inference on the PYNQ-Z1 board.

To do so, I use NNVM to compile and save the model as resnet50.json, resnet50.params and resnet50.tar files.

This code shows how I am doing it.

Then, I want to load the previously saved model and upload it to the board. To do so, I use this code.

The problem is that, when I load the graph from the JSON file, TVM raises the following error: Attribute FTVMCompute has not been registered for Operator tvm_op.

Does anyone know what I’m doing wrong here?

Thanks in advance for your answers.


Have you tried to compile with relay?


Yes, but when I try to load the library with tvm.module.load(), it says that the file is in the wrong format:

/usr/bin/ld: /tmp/tmplvk29z83/lib.o: relocations in generic ELF (EM: 40)
/usr/bin/ld: /tmp/tmplvk29z83/lib.o: relocations in generic ELF (EM: 40)
/usr/bin/ld: /tmp/tmplvk29z83/lib.o: error adding symbols: file in wrong format

I believe this is due to the fact that Relay compiles the library for the Pynq but when I load the library afterward to upload it to the board, it tries to link it with my host machine configuration.
Any idea on how to tell Relay to upload it directly to the board?

Note: According to this reply, it seems that Relay still doesn’t work with VTA.


@faku indeed, if you try to push a ResNet50 without proper quantization, bitpacking it will break. We are working on supporting this with Relay; NNVM support for VTA will be deprecated. You can track progress on Relay support for VTA here: https://github.com/dmlc/tvm/pull/3135


@thierry Thanks for the PR link!

Is there any way to have access on how the files provided in the VTA ResNet18 Inference tutorial were generated (resnet18_qt8.json, resnet18_qt8.params)?