Check failed: type_code_ == kTVMObjectHandle (0 vs. 8) : expected Object but got int

VMError: In function ir.Module_LookupDef: error while converting argument 1: [13:07:14] /home/xx/tvm/include/tvm/runtime/packed_func.h:1611: 
---------------------------------------------------------------
An error occurred during the execution of TVM.
For more information, please see: https://tvm.apache.org/docs/errors.html
---------------------------------------------------------------

  Check failed: type_code_ == kTVMObjectHandle (0 vs. 8) : expected Object but got int

my code like:

mod, params = relay.frontend.from_onnx(onnx_model, shape_dict)
    with tvm.transform.PassContext(opt_level=opt_level):
        lib = relay.build(mod, target=target, params=params)

for a, param in zip(mod, params):
            print(a, param)

original I want debug this:

tasks = autotvm.task.extract_from_multiple_program(
        mod["main"], target=target, params=params
        # mod, target=target, params=params
    )

it will call for zip inside, but the that error,

any body knows why???

Have you got any idea why this error happen?

1 Like

Any idea? I encountered the same problem.

I encountered this error when the input_shape is 1d

the shape in shape_dict should be a tuple like

shape_dict = {"input_name" : (10,) }

but not

```python
shape_dict = {"input_name" : (10) }
1 Like

I encountered this error when: mod, config = partition_for_tensorrt(mod, params)

the doc about Relay TensorRT Integration is out of date, you can do like this

mod= partition_for_tensorrt(mod, params)

with tvm.transform.PassContext(opt_level=4):

    lib = relay.build(mod, target=target, params=params)
2 Likes