Toybrick

rknn.load_pytorch 模型加载接口报错

topology

新手上路

积分
30
楼主
发表于 2021-1-11 15:02:19 | 显示全部楼层
rknn.config(channel_mean_value='123.675 116.28 103.53 58.82', reorder_channel='0 1 2')  
Input_Size = [[3,640,640]]
ret = rknn.load_pytorch(model='weights/best_person_plate_clean.pt',input_size_list=Input_Size) 出错
weights/best_person_plate_clean.pt ********************
E Catch exception when loading pytorch model: weights/best_person_plate_clean.pt!
E Traceback (most recent call last):
E   File "rknn/api/rknn_base.py", line 611, in rknn.api.rknn_base.RKNNBase.load_pytorch
E   File "rknn/base/RKNNlib/app/importer/import_pytorch.py", line 97, in rknn.base.RKNNlib.app.importer.import_pytorch.ImportPytorch.run
E   File "rknn/base/RKNNlib/converter/convert_pytorch.py", line 592, in rknn.base.RKNNlib.converter.convert_pytorch.convert_pytorch.__init__
E   File "/home/denghui/anaconda3/envs/rknn/lib/python3.6/site-packages/torch/jit/__init__.py", line 162, in load
E     cpp_module = torch._C.import_ir_module(cu, f, map_location, _extra_files)
E RuntimeError: [enforce fail at inline_container.cc:137] . PytorchStreamReader failed reading zip archive: failed finding central directory
E frame #0: c10::ThrowEnforceNotMet(char const*, int, char const*, std::string const&, void const*) + 0x5b (0x7f6d5e8d7bcb in /home/denghui/anaconda3/envs/rknn/lib/python3.6/site-packages/torch/lib/libc10.so)
E frame #1: caffe2::serialize:yTorchStreamReader::valid(char const*) + 0x6b (0x7f6d6842202b in /home/denghui/anaconda3/envs/rknn/lib/python3.6/site-packages/torch/lib/libtorch.so)
E frame #2: caffe2::serialize:yTorchStreamReader::init() + 0x9a (0x7f6d68425ada in /home/denghui/anaconda3/envs/rknn/lib/python3.6/site-packages/torch/lib/libtorch.so)
E frame #3: caffe2::serialize:yTorchStreamReader:yTorchStreamReader(std::string const&) + 0x60 (0x7f6d68428b40 in /home/denghui/anaconda3/envs/rknn/lib/python3.6/site-packages/torch/lib/libtorch.so)
E 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> > >&) + 0x38 (0x7f6d69507928 in /home/denghui/anaconda3/envs/rknn/lib/python3.6/site-packages/torch/lib/libtorch.so)
E frame #5: <unknown function> + 0x4d6903 (0x7f6d8f705903 in /home/denghui/anaconda3/envs/rknn/lib/python3.6/site-packages/torch/lib/libtorch_python.so)
E frame #6: <unknown function> + 0x1c8316 (0x7f6d8f3f7316 in /home/denghui/anaconda3/envs/rknn/lib/python3.6/site-packages/torch/lib/libtorch_python.so)
E <omitting python frames>
E frame #11: <unknown function> + 0x21266 (0x7f6d9679c266 in /home/denghui/anaconda3/envs/rknn/lib/python3.6/site-packages/rknn/base/RKNNlib/converter/convert_pytorch.cpython-36m-x86_64-linux-gnu.so)
E frame #12: <unknown function> + 0x22c07 (0x7f6d9679dc07 in /home/denghui/anaconda3/envs/rknn/lib/python3.6/site-packages/rknn/base/RKNNlib/converter/convert_pytorch.cpython-36m-x86_64-linux-gnu.so)
E frame #13: <unknown function> + 0x75ccd (0x7f6d967f0ccd in /home/denghui/anaconda3/envs/rknn/lib/python3.6/site-packages/rknn/base/RKNNlib/converter/convert_pytorch.cpython-36m-x86_64-linux-gnu.so)
E frame #19: <unknown function> + 0x6dec (0x7f6d96e3adec in /home/denghui/anaconda3/envs/rknn/lib/python3.6/site-packages/rknn/base/RKNNlib/app/importer/import_pytorch.cpython-36m-x86_64-linux-gnu.so)
E frame #20: <unknown function> + 0xd6a1 (0x7f6d96e416a1 in /home/denghui/anaconda3/envs/rknn/lib/python3.6/site-packages/rknn/base/RKNNlib/app/importer/import_pytorch.cpython-36m-x86_64-linux-gnu.so)
E frame #21: <unknown function> + 0x1388c (0x7f6d96e4788c in /home/denghui/anaconda3/envs/rknn/lib/python3.6/site-packages/rknn/base/RKNNlib/app/importer/import_pytorch.cpython-36m-x86_64-linux-gnu.so)
E frame #22: <unknown function> + 0x21f4d (0x7f6e1eda5f4d in /home/denghui/anaconda3/envs/rknn/lib/python3.6/site-packages/rknn/api/rknn_base.cpython-36m-x86_64-linux-gnu.so)
E frame #23: <unknown function> + 0x23b99 (0x7f6e1eda7b99 in /home/denghui/anaconda3/envs/rknn/lib/python3.6/site-packages/rknn/api/rknn_base.cpython-36m-x86_64-linux-gnu.so)
E frame #24: <unknown function> + 0xa085c (0x7f6e1ee2485c in /home/denghui/anaconda3/envs/rknn/lib/python3.6/site-packages/rknn/api/rknn_base.cpython-36m-x86_64-linux-gnu.so)
E frame #39: __libc_start_main + 0xf0 (0x7f6e5cc36840 in /lib/x86_64-linux-gnu/libc.so.6)
Load model failed!
回复

使用道具 举报

topology

新手上路

积分
30
沙发
发表于 2021-1-11 15:04:34 | 显示全部楼层
请教是什么问题?环境python:3.6,torch:1.2.0,torchvision:0.4.0,rknn:1.3.3b2,tensorflow:1.11.0
回复

使用道具 举报

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

本版积分规则

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


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