crnn-pytorch icon indicating copy to clipboard operation
crnn-pytorch copied to clipboard

Libtorch Error

Open Grungeby52 opened this issue 7 months ago • 0 comments

I want to use my own trained model in libtorch, but I'm unable to do so. I'm encountering the following error.

terminate called after throwing an instance of 'c10::Error' what(): open file failed, file path: src/crnn_synth90k.pt Exception raised from FileAdapter at /home/asis/pytorch1.8/pytorch/caffe2/serialize/file_adapter.cc:11 (most recent call first): frame #0: c10::Error::Error(c10::SourceLocation, std::__cxx11::basic_string<char, std::char_traits, std::allocator >) + 0x6b (0x7f75c1f6695b in /home/asis/pytorch1.8/pytorch/torch/lib/libc10.so) frame #1: c10::detail::torchCheckFail(char const*, char const*, unsigned int, std::__cxx11::basic_string<char, std::char_traits, std::allocator > const&) + 0xce (0x7f75c1f631be in /home/asis/pytorch1.8/pytorch/torch/lib/libc10.so) frame #2: caffe2::serialize::FileAdapter::FileAdapter(std::__cxx11::basic_string<char, std::char_traits, std::allocator > const&) + 0x258 (0x7f75b7452568 in /home/asis/pytorch1.8/pytorch/torch/lib/libtorch_cpu.so) frame #3: 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 > > > >&) + 0x40 (0x7f75b89ef750 in /home/asis/pytorch1.8/pytorch/torch/lib/libtorch_cpu.so) frame #4: torch::jit::load(std::__cxx11::basic_string<char, std::char_traits, std::allocator > const&, c10::optionalc10::Device) + 0x6f (0x7f75b89ef8df in /home/asis/pytorch1.8/pytorch/torch/lib/libtorch_cpu.so) frame #5: Crnn::Crnn(std::__cxx11::basic_string<char, std::char_traits, std::allocator >&, std::__cxx11::basic_string<char, std::char_traits, std::allocator >&) + 0x68 (0x55c6271749a8 in ./CrnnDeploy) frame #6: main + 0xbe (0x55c62717391e in ./CrnnDeploy) frame #7: __libc_start_main + 0xe7 (0x7f75a8e4dc87 in /lib/x86_64-linux-gnu/libc.so.6) frame #8: _start + 0x2a (0x55c627173afa in ./CrnnDeploy)

Grungeby52 avatar Nov 10 '23 14:11 Grungeby52