Relax frontend Reshape issue

I’m trying to load onnx model with relax.from_onnx() with the latest unity branch(c0b8953), got the following error while constructing the Reshape node, dose anyone met it before? and perhaps solution?

    5: tvm::relax::Normalizer::Normalize(tvm::RelayExpr const&)
          at /path/tvm/src/relax/ir/
    4: tvm::relax::Normalizer::VisitExpr(tvm::RelayExpr const&)
          at /path/tvm/src/relax/ir/
    3: tvm::relax::Normalizer::VisitExpr_(tvm::relax::CallNode const*)
          at /path/tvm/src/relax/ir/
    2: tvm::relax::Normalizer::InferStructInfo(tvm::relax::Call const&)
          at /path/tvm/src/relax/ir/
    1: tvm::relax::InferStructInfoReshape(tvm::relax::Call const&, tvm::relax::BlockBuilder const&)
          at /path/tvm/src/relax/op/tensor/
    0: tvm::relax::BlockBuilderImpl::ReportFatal(tvm::Diagnostic const&)
          at /path/tvm/src/relax/ir/
    File "/path/tvm/src/relax/ir/", line 138
    TVMError: Reshape requires the input new shape to be Shape. However, the given one is relax.TensorStructInfo
    [18:14:48] /path/tvm/src/relax/ir/ Warning: BlockBuilder destroyed with remaining blocks!

in the onnx graph the reshape op’ input is relax.Call, one is relax.add, the other is relax.concat()

That might be an issue of the ONNX frontend, it’s not hard to fix it in the file

1 Like