Sorry the model was saved like this
Python code:
traced_scrip_module = torch.jit.script(net)
traced_script_module.jit.save(“net_0.pt”)
C++ error:
terminate called after throwing an instance of ‘c10::Error’
what(): [enforce fail at inline_container.cc:144] . PytorchStreamReader failed reading zip archive: failed finding central directory
frame #0: c10::ThrowEnforceNotMet(char const*, int, char const*, std::__cxx11::basic_string<char, std::char_traits, std::allocator > const&, void const*) + 0x67 (0x7f3ceac4cfc7 in /home/ubuntu/cfr/libtorch/lib/libc10.so)
frame #1: caffe2::serialize::PyTorchStreamReader::valid(char const*, char const*) + 0xac (0x7f3cdccebf5c in /home/ubuntu/cfr/libtorch/lib/libtorch_cpu.so)
frame #2: caffe2::serialize::PyTorchStreamReader::init() + 0xb0 (0x7f3cdccee110 in /home/ubuntu/cfr/libtorch/lib/libtorch_cpu.so)
frame #3: caffe2::serialize::PyTorchStreamReader::PyTorchStreamReader(std::unique_ptr<caffe2::serialize::ReadAdapterInterface, std::default_deletecaffe2::serialize::ReadAdapterInterface >) + 0x6d (0x7f3cdccf04bd in /home/ubuntu/cfr/libtorch/lib/libtorch_cpu.so)
frame #4: + 0x36cb15f (0x7f3cde0f515f in /home/ubuntu/cfr/libtorch/lib/libtorch_cpu.so)
frame #5: torch::jit::load(std::unique_ptr<caffe2::serialize::ReadAdapterInterface, std::default_deletecaffe2::serialize::ReadAdapterInterface >, c10::optionalc10::Device, std::unordered_map<std::__cxx11::basic_string<char, std::char_traits, std::allocator >, std::__cxx11::basic_string<char, std::char_traits, std::allocator >, std::hash<std::__cxx11::basic_string<char, std::char_traits, std::allocator > >, std::equal_to<std::__cxx11::basic_string<char, std::char_traits, std::allocator > >, std::allocator<std::pair<std::__cxx11::basic_string<char, std::char_traits, std::allocator > const, std::__cxx11::basic_string<char, std::char_traits, std::allocator > > > >&) + 0x67 (0x7f3cde0f1697 in /home/ubuntu/cfr/libtorch/lib/libtorch_cpu.so)
frame #6: torch::jit::load(std::__cxx11::basic_string<char, std::char_traits, std::allocator > const&, c10::optionalc10::Device, std::unordered_map<std::__cxx11::basic_string<char, std::char_traits, std::allocator >, std::__cxx11::basic_string<char, std::char_traits, std::allocator >, std::hash<std::__cxx11::basic_string<char, std::char_traits, std::allocator > >, std::equal_to<std::__cxx11::basic_string<char, std::char_traits, std::allocator > >, std::allocator<std::pair<std::__cxx11::basic_string<char, std::char_traits, std::allocator > const, std::__cxx11::basic_string<char, std::char_traits, std::allocator > > > >&) + 0x75 (0x7f3cde0f4355 in /home/ubuntu/cfr/libtorch/lib/libtorch_cpu.so)
frame #7: + 0xc4e0 (0x5609e3aa64e0 in ./cfr)
frame #8: + 0xff11 (0x5609e3aa9f11 in ./cfr)
frame #9: __libc_start_main + 0xe7 (0x7f3cd98fab97 in /lib/x86_64-linux-gnu/libc.so.6)
frame #10: + 0x88da (0x5609e3aa28da in ./cfr)
Aborted (core dumped)