Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

terminate called after throwing an instance of 'c10::Error' #2

Open
YznMur opened this issue Jul 22, 2023 · 1 comment
Open

terminate called after throwing an instance of 'c10::Error' #2

YznMur opened this issue Jul 22, 2023 · 1 comment

Comments

@YznMur
Copy link

YznMur commented Jul 22, 2023

Hi,

Got this error when running rosrun loop_hloc loop_hloc_node ./src/ov_hloc/config/master_config.yaml:


config_file: /home/trainer/ovhloc/workspace/catkin_ws_ov/src/ov_hloc/config/master_config.yaml
[ WARN] [1690048092.565376487]: Loading HF-Net...
terminate called after throwing an instance of 'c10::Error'
  what():  Unrecognized data format
Exception raised from load at ../torch/csrc/jit/serialization/import.cpp:449 (most recent call first):
frame #0: c10::Error::Error(c10::SourceLocation, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >) + 0x6b (0x7f35cf1ad2eb in /home/trainer/ovhloc/workspace/catkin_ws_ov/src/libtorch/lib/libc10.so)
frame #1: c10::detail::torchCheckFail(char const*, char const*, unsigned int, char const*) + 0xd1 (0x7f35cf1a8e41 in /home/trainer/ovhloc/workspace/catkin_ws_ov/src/libtorch/lib/libc10.so)
frame #2: torch::jit::load(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, c10::optional<c10::Device>, std::unordered_map<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::hash<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > >, std::equal_to<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > >, std::allocator<std::pair<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > > > >&) + 0x1b6 (0x7f35a5635876 in /home/trainer/ovhloc/workspace/catkin_ws_ov/src/libtorch/lib/libtorch_cpu.so)
frame #3: torch::jit::load(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, c10::optional<c10::Device>) + 0x6f (0x7f35a563594f in /home/trainer/ovhloc/workspace/catkin_ws_ov/src/libtorch/lib/libtorch_cpu.so)
frame #4: SuperPoint::SuperPoint() + 0x78 (0x559439d64698 in /home/trainer/ovhloc/workspace/catkin_ws_ov/devel_isolated/loop_hloc/lib/loop_hloc/loop_hloc_node)
frame #5: SuperPoint::Extract(cv::Mat const&, std::vector<cv::Point_<float>, std::allocator<cv::Point_<float> > >&, std::vector<float, std::allocator<float> >&, cv::Mat&) + 0x6c (0x559439d67b3c in /home/trainer/ovhloc/workspace/catkin_ws_ov/devel_isolated/loop_hloc/lib/loop_hloc/loop_hloc_node)
frame #6: init_hloc() + 0x1fc (0x559439d16e5c in /home/trainer/ovhloc/workspace/catkin_ws_ov/devel_isolated/loop_hloc/lib/loop_hloc/loop_hloc_node)
frame #7: main + 0x35a (0x559439d132ba in /home/trainer/ovhloc/workspace/catkin_ws_ov/devel_isolated/loop_hloc/lib/loop_hloc/loop_hloc_node)
frame #8: __libc_start_main + 0xf3 (0x7f3577c67083 in /usr/lib/x86_64-linux-gnu/libc.so.6)
frame #9: _start + 0x2e (0x559439d1630e in /home/trainer/ovhloc/workspace/catkin_ws_ov/devel_isolated/loop_hloc/lib/loop_hloc/loop_hloc_node)

Aborted (core dumped)

Using:
cuda11.3.1
cudnn8
ubuntu20.04
python3.8
torch1.12.1
libtorch-cxx11-abi-shared-with-deps-1.12.1
ceres-solver-2.0.0

Any ideas?

@Li-Jesse-Jiaze
Copy link
Owner

Li-Jesse-Jiaze commented Jul 27, 2023

Thanks for trying to run my code!

It appears that the error is occurring during the loading of the SuperPoint model. Have you properly converted the model? Please ensure that the correctly converted model file exists in the path specified by this macro definition.

#define SuperPointPath "/home/jesse/workspace/catkin_ws_ov/src/ov_hloc/support_files/models/SuperPoint_300.pt"
#define NetVLADPath "/home/jesse/workspace/catkin_ws_ov/src/ov_hloc/support_files/models/NetVLAD.pt"
#define SuperGluePath "/home/jesse/workspace/catkin_ws_ov/src/ov_hloc/support_files/models/SuperGlue_outdoor.pt"
#define UltraPointPath "/home/jesse/workspace/catkin_ws_ov/src/ov_hloc/support_files/models/UltraPoint.pt"

The default path here is the one in my computer. Sorry I didn't use a better way to read the relative path, you may need to change it.

If you are still encountering errors, please provide additional information so that I can offer further assistance.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants