caffe2_pybind11_state.so: undefined symbol: __cpu_model
I have compiled caffe2 with CUDA, or without CUDA successful, then use python to import caffe2.python.core, it appeared such error:
WARNING:root:This caffe2 python run does not have GPU support. Will run in CPU only mode. WARNING:root:Debug message: No module named caffe2_pybind11_state_gpu CRITICAL:root:Cannot load caffe2.python. Error: caffe2/python/caffe2_pybind11_state.so: undefined symbol: __cpu_model
What build environment do you have?
@Yangqing ubuntu 14.04 cuda8.0 cudnn5 gcc 4.8
/cc @benbarsdell
Yep I ran into something similar with the same environment, and had to make this change in CMakeLists.txt:
-if(CMAKE_COMPILER_IS_GNUCXX AND CMAKE_CXX_COMPILER_VERSION VERSION_GREATER 5.0.0)
+if(CMAKE_COMPILER_IS_GNUCXX AND CMAKE_CXX_COMPILER_VERSION VERSION_GREATER 4.8.0)
Nice catch - thanks @benbarsdell ! Will commit a PR.
Thanks @Yangqing @benbarsdell
I cannot import caffe2.python.core with python3.5, while it can import correctly with python 2.7. The error message is: WARNING:root:This caffe2 python run does not have GPU support. Will run in CPU only mode. WARNING:root:Debug message: dynamic module does not define module export function (PyInit_caffe2_pybind11_state_gpu)