当前位置: 首页 > news >正文

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

http://www.lryc.cn/news/318537.html

相关文章:

  • 十、项目沟通管理
  • SQL设计时增加说明列
  • 前端提高性能——使用Intersection Observer API对图片视频进行懒加载
  • 杂七杂八111
  • 微信小程序(一)
  • 【DL经典回顾】激活函数大汇总(十二)(GLU ReGLU附代码和详细公式)
  • 【C++】string类初步介绍
  • HCIP --- BGP 综合实验
  • 【优选算法】专题1 -- 双指针 -- 移动零
  • 【计算机视觉】二、图像形成:2、几何基元和几何变换:2D变换
  • 蓝桥杯---棋盘(典型的二维差分问题)
  • OpenHarmony教程指南—ArkTS时钟
  • uniapp遇到的问题
  • oppo前端开发一面
  • 案例分析篇09:Web架构设计相关20个考点(7~11)(2024年软考高级系统架构设计师冲刺知识点总结)
  • 为什么“玄学”与营销联系?媒介盒子分析
  • C++常用容器总结
  • C# Onnx C2PNet 图像去雾 室外场景
  • 【English Learning】Day13
  • 智障版本GPT3实现
  • 【ubuntu】安装 Anaconda3
  • 代码随想录|Day20|二叉树09|669. 修剪二叉搜索树、108.将有序数组转换为二叉搜索树、538.把二叉搜索树转换为累加树
  • 开源的java 代码分析库介绍
  • 基于udp协议的网络通信(windows客户端版+简易聊天室版),重定向到终端
  • Qt+FFmpeg+opengl从零制作视频播放器-7.OpenGL播放视频
  • 用两个栈实现简单的四则运算
  • <个人笔记>数论
  • CMS垃圾收集
  • Incorrect DECIMAL value: ‘0‘ for column ‘‘ at row -1
  • Vue3组件通信的方式