Errors importing models from ONNX Model Zoo

I am trying to import some pre-trained ONNX models from here
I have met some issues, and I was wondering if there is something I can do about them apart from writing the models again from scratch (or importing them from frameworks other than ONNX).

  • AlexNet and ZFNet: error when building the models
    File "/.../tvm/topi/include/topi/nn/local_response_norm.h", line 58
    TVMError: Check failed: data->shape.size() == 4 (5 vs. 4) : LRN requires 4-D input

  • GoogleNet: error when building the model
    File "/../tvm/src/arithmetic/const_fold.h", line 198
    TVMError: Check failed: pb->value != 0 (0 vs. 0) : Divide by zero

Any advice? The models work fine if I run them on OnnxRuntime, so I doubt there are intrinsic errors in their structures. These look more like incompatibilities with TVM.

I meet the same problem when i convert inceptionv3 tflite to tvm. Do you solve this problem?

No I didn’t solve it yet. I managed to import a pre-trained model for AlexNet from MXNet and one for GoogleNet from TensorFlow, but this is not the ideal solution for me, since I am evaluating how ONNX models can work. I think it is just a matter of unsupported operators.

1 Like

The question still exist in latest tvm.

I met the same problem before.
Try to set opt_level=2 while build config

1 Like

It worked for ZFNet, thank you!

But I still get the same error with GoogleNet (even with opt_level=1), and the error compiling AlexNet changed to:

File "/.../tvm/python/tvm/autotvm/task/", line 163, in get_factors
    list.__add__, ([i, n//i] for i in range(1, int(math.sqrt(n)) + 1, step)
TypeError: reduce() of empty sequence with no initial value