Toybrick

pytorch模型转rknn失败

Luhaibin

中级会员

积分
245
发表于 2020-5-21 09:25:40    查看: 1210|回复: 3 | [复制链接]    打印 | 显示全部楼层
下面是打印的日志,请问这个是因为什么?

--> config model
done
--> Loading model
/home/luhaibin/.local/lib/python3.5/site-packages/onnx_tf/common/__init__.py:87: UserWarning: FrontendHandler.get_outputs_names is deprecated. It will be removed in future release.. Use node.outputs instead.
  warnings.warn(message)
./siamfc_alexnet1.pt ********************
terminate called after throwing an instance of 'c10::Error'
  what():  [enforce fail at inline_container.cc:137] . PytorchStreamReader failed closing reader: file not found
frame #0: c10::ThrowEnforceNotMet(char const*, int, char const*, std::string const&, void const*) + 0x47 (0x7f29ff5e3e17 in /usr/local/lib/python3.5/dist-packages/torch/lib/libc10.so)
frame #1: caffe2::serialize:yTorchStreamReader::valid(char const*) + 0x6b (0x7f2a01438ceb in /usr/local/lib/python3.5/dist-packages/torch/lib/libtorch.so)
frame #2: caffe2::serialize:yTorchStreamReader::~PyTorchStreamReader() + 0x1f (0x7f2a01438d3f in /usr/local/lib/python3.5/dist-packages/torch/lib/libtorch.so)
frame #3: <unknown function> + 0x2d0dbc7 (0x7f2a02517bc7 in /usr/local/lib/python3.5/dist-packages/torch/lib/libtorch.so)
frame #4: torch::jit::import_ir_module(std::shared_ptr<torch::jit::script::CompilationUnit>, std::string const&, c10:ptional<c10:evice>, std::unordered_map<std::string, std::string, std::hash<std::string>, std::equal_to<std::string>, std::allocator<std::pair<std::string const, std::string> > >&) + 0x1d0 (0x7f2a0251e7b0 in /usr/local/lib/python3.5/dist-packages/torch/lib/libtorch.so)
frame #5: <unknown function> + 0x493d9c (0x7f2a0bea9d9c in /usr/local/lib/python3.5/dist-packages/torch/lib/libtorch_python.so)
frame #6: <unknown function> + 0x19da74 (0x7f2a0bbb3a74 in /usr/local/lib/python3.5/dist-packages/torch/lib/libtorch_python.so)
<omitting python frames>
frame #10: <unknown function> + 0x18725 (0x7f29fe1fb725 in /home/luhaibin/.local/lib/python3.5/site-packages/rknn/base/acuitylib/converter/convert_pytorch.cpython-35m-x86_64-linux-gnu.so)
frame #11: <unknown function> + 0x1906f (0x7f29fe1fc06f in /home/luhaibin/.local/lib/python3.5/site-packages/rknn/base/acuitylib/converter/convert_pytorch.cpython-35m-x86_64-linux-gnu.so)
frame #12: <unknown function> + 0x69508 (0x7f29fe24c508 in /home/luhaibin/.local/lib/python3.5/site-packages/rknn/base/acuitylib/converter/convert_pytorch.cpython-35m-x86_64-linux-gnu.so)
frame #14: python3() [0x4f08be]
frame #16: python3() [0x55fa59]
frame #17: python3() [0x579f4c]
frame #18: <unknown function> + 0x6a10 (0x7f29fe4b1a10 in /home/luhaibin/.local/lib/python3.5/site-packages/rknn/base/acuitylib/app/importer/import_pytorch.cpython-35m-x86_64-linux-gnu.so)
frame #19: <unknown function> + 0xc0cb (0x7f29fe4b70cb in /home/luhaibin/.local/lib/python3.5/site-packages/rknn/base/acuitylib/app/importer/import_pytorch.cpython-35m-x86_64-linux-gnu.so)
frame #20: <unknown function> + 0x213ad (0x7f2a6110d3ad in /home/luhaibin/.local/lib/python3.5/site-packages/rknn/api/rknn_base.cpython-35m-x86_64-linux-gnu.so)
frame #21: <unknown function> + 0x21572 (0x7f2a6110d572 in /home/luhaibin/.local/lib/python3.5/site-packages/rknn/api/rknn_base.cpython-35m-x86_64-linux-gnu.so)
frame #22: <unknown function> + 0x40ac8 (0x7f2a6112cac8 in /home/luhaibin/.local/lib/python3.5/site-packages/rknn/api/rknn_base.cpython-35m-x86_64-linux-gnu.so)
frame #25: python3() [0x539a13]
frame #27: python3() [0x539a13]
frame #29: python3() [0x6292c2]
frame #34: __libc_start_main + 0xf0 (0x7f2a77384830 in /lib/x86_64-linux-gnu/libc.so.6)

Aborted (core dumped)


回复

使用道具 举报

jefferyzhang

超级版主

积分
7726
发表于 2020-5-21 11:21:33 | 显示全部楼层
/usr/local/lib/python3.5/dist-packages/torch/lib/libtorch.so
环境问题吧,先把本地pytorch正常跑起来,然后能保存模型,并自己加载pth模型推理成功了再转rknn啊
还有rknn目前只支持到1.2的pytorch。先仔细看下文档啊
回复

使用道具 举报

Luhaibin

中级会员

积分
245
 楼主| 发表于 2020-5-21 13:05:30 | 显示全部楼层
jefferyzhang 发表于 2020-5-21 11:21
/usr/local/lib/python3.5/dist-packages/torch/lib/libtorch.so
环境问题吧,先把本地pytorch正常跑起来 ...

转化成功了,是pytorch版本的问题,感谢大佬
回复

使用道具 举报

yang_allen

新手上路

积分
42
发表于 2020-8-26 18:20:56 | 显示全部楼层
Luhaibin 发表于 2020-5-21 13:05
转化成功了,是pytorch版本的问题,感谢大佬

我也遇到类似的问题,请问你是怎么解决的呀
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

产品中心 购买渠道 开源社区 Wiki教程 资料下载 关于Toybrick


快速回复 返回顶部 返回列表