本文主要是介绍tvm android_rpc_test.py执行报错解决,希望对大家解决编程问题提供一定的参考价值,需要的开发者们随着小编来一起学习吧!
执行 python3 tests/android_rpc_test.py
报错:
Run CPU test ...
Traceback (most recent call last):
File "tests/android_rpc_test.py", line 129, in <module>
test_rpc_module()
File "tests/android_rpc_test.py", line 73, in test_rpc_module
f2 = remote.load_module("cpu_lib.tar")
File "/root/.local/lib/python3.8/site-packages/tvm-0.13.0-py3.8-linux-x86_64.egg/tvm/rpc/client.py", line 161, in load_module
return _ffi_api.LoadRemoteModule(self._sess, path)
File "/root/.local/lib/python3.8/site-packages/tvm-0.13.0-py3.8-linux-x86_64.egg/tvm/_ffi/_ctypes/packed_func.py", line 238, in __call__
raise get_last_ffi_error()
tvm.error.InternalError: Traceback (most recent call last):
4: TVMFuncCall
3: _ZN3tvm7runtime13PackedFuncObj9ExtractorINS0_16PackedFuncSubObjIZNS0_15TypedPackedFuncIFNS0_6ModuleES5_NSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEEE17AssignTypedLambdaINS0_UlS5_SB_E3_EEEvT_SB_EUlRKNS0_7TVMArgsEPNS0_11TVMRetValueEE_EEE4CallEPKS1_SH_SL_
2: tvm::runtime::RPCWrappedFunc::operator()(tvm::runtime::TVMArgs, tvm::runtime::TVMRetValue*) const
1: tvm::runtime::RPCClientSession::CallFunc(void*, TVMValue const*, int const*, int, std::function<void (tvm::runtime::TVMArgs)> const&)
0: tvm::runtime::RPCEndpoint::CallFunc(void*, TVMValue const*, int const*, int, std::function<void (tvm::runtime::TVMArgs)>)
File "/home/tt/project/docker_tvm2/tvm/src/runtime/rpc/rpc_endpoint.cc", line 808
InternalError: Check failed: (code == RPCCode::kReturn) is false: code=kShutdown
解决方法:
把cpu_lib.tar改为cpu_lib.so;并且在export_library添加ndk.create_shared,如下:
path_dso_cpu = temp.relpath("cpu_lib.so")
f.export_library(path_dso_cpu, ndk.create_shared)
原因:
没有添加ndk.create_shared,使用默认的编译器,在android上不能跑
这篇关于tvm android_rpc_test.py执行报错解决的文章就介绍到这儿,希望我们推荐的文章对编程师们有所帮助!