# TensorRT integration error occurred

**URL:** <https://discuss.tvm.apache.org/t/tensorrt-integration-error-occurred/13095>\
**Category:** Troubleshooting\
**Created:** [July 8, 2022, 2:56am UTC](https://discuss.tvm.apache.org/t/tensorrt-integration-error-occurred/13095 "2022-07-08T02:56:19Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Felix2](https://discuss.tvm.apache.org/letter_avatar_proxy/v4/letter/f/6f9a4e/32.png) [@Felix2](https://discuss.tvm.apache.org/u/Felix2)\
**Post date:** [July 8, 2022, 2:56am UTC](https://discuss.tvm.apache.org/t/tensorrt-integration-error-occurred/13095/1 "2022-07-08T02:56:19Z")

</div>

**ENV:** CUDA 11.6, TensorRT 8.4, CUDNN was installed by TensorRT DEB installation package

**SYSTEM:** Debian and Debian(WSL2) both met same problem

**ERROR MESSAGES:**

```
Traceback (most recent call last):
    partition_for_tensorrt(mod, params)
  File "/home/Dev/tvm/python/tvm/ir/module.py", line 108, in __getitem__
    return _ffi_api.Module_LookupDef(self, var)
  File "/home/Dev/tvm/python/tvm/_ffi/_ctypes/packed_func.py", line 237, in __call__
    raise get_last_ffi_error()
tvm._ffi.base.TVMError: Traceback (most recent call last):
  3: TVMFuncCall
  2: tvm::runtime::PackedFuncObj::Extractor<tvm::runtime::PackedFuncSubObj<tvm::runtime::TypedPackedFunc<tvm::TypeData (tvm::IRModule, tvm::GlobalTypeVar)>::AssignTypedLambda<tvm::__mk_TVM13::{lambda(tvm::IRModule, tvm::GlobalTypeVar)#1}>(tvm::__mk_TVM13::{lambda(tvm::IRModule, tvm::GlobalTypeVar)#1}, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >)::{lambda(tvm::runtime::TVMArgs const&, tvm::runtime::TVMRetValue*)#1}> >::Call(tvm::runtime::PackedFuncObj const*, std::allocator<char>, tvm::runtime::TVMArgs const&)
  1: tvm::runtime::TVMMovableArgValueWithContext_::operator tvm::GlobalTypeVar<tvm::GlobalTypeVar>() const
  0: _ZN3tvm7runtime6deta
  4: TVMFuncCall
  3: tvm::runtime::PackedFuncObj::Extractor<tvm::runtime::PackedFuncSubObj<tvm::runtime::TypedPackedFunc<tvm::TypeData (tvm::IRModule, tvm::GlobalTypeVar)>::AssignTypedLambda<tvm::__mk_TVM13::{lambda(tvm::IRModule, tvm::GlobalTypeVar)#1}>(tvm::__mk_TVM13::{lambda(tvm::IRModule, tvm::GlobalTypeVar)#1}, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >)::{lambda(tvm::runtime::TVMArgs const&, tvm::runtime::TVMRetValue*)#1}> >::Call(tvm::runtime::PackedFuncObj const*, std::allocator<char>, tvm::runtime::TVMArgs const&)
  2: tvm::runtime::TVMMovableArgValueWithContext_::operator tvm::GlobalTypeVar<tvm::GlobalTypeVar>() const
  1: tvm::GlobalTypeVar tvm::runtime::TVMPODValue_::AsObjectRef<tvm::GlobalTypeVar>() const
  0: _ZN3tvm7runtime6deta
  File "../include/tvm/runtime/packed_func.h", line 777
TVMError: In function ir.Module_LookupDef(0: IRModule, 1: GlobalTypeVar) -> relay.TypeData: error while converting argument 1: [04:47:11] ../include/tvm/runtime/packed_func.h:1887: 
---------------------------------------------------------------
An error occurred during the execution of TVM.
For more information, please see: 
---------------------------------------------------------------

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

---

<div class="post-metadata">

**Author:** ![BaoYu0721](https://discuss.tvm.apache.org/user_avatar/discuss.tvm.apache.org/baoyu0721/32/4289_2.png) [@BaoYu0721](https://discuss.tvm.apache.org/u/BaoYu0721)\
**Post date:** [October 21, 2022, 4:16am UTC](https://discuss.tvm.apache.org/t/tensorrt-integration-error-occurred/13095/2 "2022-10-21T04:16:42Z")

</div>

The return value of “partition\_for\_tensorrt” has changed, change the code from

> mod, config = partition\_for\_tensorrt(mod, params)

to:

> mod = partition\_for\_tensorrt(mod, params)

may solve this problem
