I am having a hard time running pytorch model with ROS in C++. The torchlib breaks the ROS when I try to include it in my package cmakelist. I included the moden ABI by “add_compile_options(-std=c++11 -D_GLIBCXX_USE_CXX11_ABI=1)” but it didn’t help too.
After many tries I decided to built pytorch but then I got a new error for c10, the error log can be found here https://gist.github.com/sanketgujar/8c55c8536910a0ede84133688fb5af41. I tried changes in the previous similar post but nothing is helping. The TORCH_CXX_FLAGS D_GLIBCXX_USE_CXX11_ABI=1 flag is already 1 for me as default in the TorchConfig.cmake.
Yes I made sure both are using the same ABI. I am using
add_definitions(-D_GLIBCXX_USE_CXX11_ABI=1) for ROS package cmake files and changed the TorchConfig.cmake for the pytorch one.