小工具知识网

当前位置: 首页 > 行业知识 > tvm android

行业知识

tvm android

2026-11-14 00:02:17 来源:互联网转载

���行 python3 tests/android_rpc_test.py

()

报错:

Run CPU test ...

()

Traceback (most recent call last):

  File "tests/android_rpc_test.py", line 129, in

    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 const&)

  0: tvm::runtime::RPCEndpoint::CallFunc(void*, TVMValue const*, int const*, int, std::function)

  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上不能跑

上一篇:外网服务器安全警示,犯罪行为的防范与应对策略!

下一篇:揭秘下载偏好,迅雷为何不再总是用户首选?