Issue description
Compilation of pretrained GluonCV CenterNet models fails with TypeError “mismatched types”.
Steps to reproduce the issue
- Prepare hardware and environment that meet the requirements for TVM
- Install MXNet 1.5.1 or 1.6.0, GluonCV 0.7.0, and the latest MKL-DNN library
- Build TVM with USE_MKLDNN ON
- Download a pretrained CenterNet model
center_net_resnet*
from GluonCV withgluoncv.model_zoo.get_model()
- Convert the model to a TVM Relay graph with
tvm.relay.frontend.from_mxnet()
- Compile the graph with
tvm.relay.build()
at opt_level 3
What’s the expected result?
- Compilation succeeds
What’s the actual result?
-
Compilation fails with the following TypeError:
File "/usr/tvm/src/tir/ir/expr.cc", line 238 TypeError: Check failed: a.dtype() == b.dtype(): mismatched types
Additional details
- The offending graph node is a MulNode representing the multiplication of arguments
a
andb
- The type of argument
a
is changed fromint32
toint64
byVisitExpr()
before it is passed on to various checks in the MulNode implementation - One such check requires
a
andb
to have the same type - The error is thrown by this check because
a
is of typeint64
whereasb
is of typeint32
- If this check is commented out, compilation succeeds and inference may be successfully executed
Suggested solutions
- Add support for GluonCV CenterNet pretrained models to TVM