标题: pytorch模型转换失败 [打印本页] 作者: happylinhxl 时间: 2020-12-29 09:49 标题: pytorch模型转换失败 环境:ubuntu16.04, rknn_toolkit_v1.4.0 , python3.6, tensorflow=1.13.1, pytorch=1.2.0 torchvision=0.4.0
加载模型文件出错。错误如下:
E Catch exception when loading pytorch model: ./model_070000.pth!
E Traceback (most recent call last):
E File "rknn/api/rknn_base.py", line 657, 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 737, in rknn.base.RKNNlib.converter.convert_pytorch.convert_pytorch.__init__
E File "/home/hxl/miniconda3/envs/rknn140/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 (0x7efd8d5e1bcb in /home/hxl/miniconda3/envs/rknn140/lib/python3.6/site-packages/torch/lib/libc10.so)
E frame #1: caffe2::serialize:yTorchStreamReader::valid(char const*) + 0x6b (0x7efd8f1ce12b in /home/hxl/miniconda3/envs/rknn140/lib/python3.6/site-packages/torch/lib/libtorch.so)
E frame #2: caffe2::serialize:yTorchStreamReader::init() + 0x9a (0x7efd8f1d1bda in /home/hxl/miniconda3/envs/rknn140/lib/python3.6/site-packages/torch/lib/libtorch.so)
E frame #3: caffe2::serialize:yTorchStreamReader:yTorchStreamReader(std::string const&) + 0x60 (0x7efd8f1d4c40 in /home/hxl/miniconda3/envs/rknn140/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 (0x7efd902b3a28 in /home/hxl/miniconda3/envs/rknn140/lib/python3.6/site-packages/torch/lib/libtorch.so)
E frame #5: <unknown function> + 0x498723 (0x7efd92402723 in /home/hxl/miniconda3/envs/rknn140/lib/python3.6/site-packages/torch/lib/libtorch_python.so)
E frame #6: <unknown function> + 0x1977b6 (0x7efd921017b6 in /home/hxl/miniconda3/envs/rknn140/lib/python3.6/site-packages/torch/lib/libtorch_python.so)
E <omitting python frames>
E frame #11: <unknown function> + 0x1d888 (0x7efd96710888 in /home/hxl/miniconda3/envs/rknn140/lib/python3.6/site-packages/rknn/base/RKNNlib/converter/convert_pytorch.cpython-36m-x86_64-linux-gnu.so)
E frame #12: <unknown function> + 0x1e457 (0x7efd96711457 in /home/hxl/miniconda3/envs/rknn140/lib/python3.6/site-packages/rknn/base/RKNNlib/converter/convert_pytorch.cpython-36m-x86_64-linux-gnu.so)
E frame #13: <unknown function> + 0xc5a3d (0x7efd967b8a3d in /home/hxl/miniconda3/envs/rknn140/lib/python3.6/site-packages/rknn/base/RKNNlib/converter/convert_pytorch.cpython-36m-x86_64-linux-gnu.so)
E frame #19: <unknown function> + 0x659c (0x7efd97f7859c in /home/hxl/miniconda3/envs/rknn140/lib/python3.6/site-packages/rknn/base/RKNNlib/app/importer/import_pytorch.cpython-36m-x86_64-linux-gnu.so)
E frame #20: <unknown function> + 0xc851 (0x7efd97f7e851 in /home/hxl/miniconda3/envs/rknn140/lib/python3.6/site-packages/rknn/base/RKNNlib/app/importer/import_pytorch.cpython-36m-x86_64-linux-gnu.so)
E frame #21: <unknown function> + 0x14a6c (0x7efd97f86a6c in /home/hxl/miniconda3/envs/rknn140/lib/python3.6/site-packages/rknn/base/RKNNlib/app/importer/import_pytorch.cpython-36m-x86_64-linux-gnu.so)
E frame #22: <unknown function> + 0x22e2d (0x7efddc369e2d in /home/hxl/miniconda3/envs/rknn140/lib/python3.6/site-packages/rknn/api/rknn_base.cpython-36m-x86_64-linux-gnu.so)
E frame #23: <unknown function> + 0x2302e (0x7efddc36a02e in /home/hxl/miniconda3/envs/rknn140/lib/python3.6/site-packages/rknn/api/rknn_base.cpython-36m-x86_64-linux-gnu.so)
E frame #24: <unknown function> + 0x6673b (0x7efddc3ad73b in /home/hxl/miniconda3/envs/rknn140/lib/python3.6/site-packages/rknn/api/rknn_base.cpython-36m-x86_64-linux-gnu.so)
E frame #39: __libc_start_main + 0xf0 (0x7efdec5ba840 in /lib/x86_64-linux-gnu/libc.so.6)