caffe2 icon indicating copy to clipboard operation
caffe2 copied to clipboard

caffe2_pybind11_state.so: undefined symbol: __cpu_model

Open terrychenism opened this issue 9 years ago • 7 comments

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

terrychenism avatar Mar 13 '17 07:03 terrychenism

What build environment do you have?

Yangqing avatar Mar 15 '17 01:03 Yangqing

@Yangqing ubuntu 14.04 cuda8.0 cudnn5 gcc 4.8

terrychenism avatar Mar 15 '17 01:03 terrychenism

/cc @benbarsdell

lukeyeager avatar Mar 15 '17 02:03 lukeyeager

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)

benbarsdell avatar Mar 15 '17 03:03 benbarsdell

Nice catch - thanks @benbarsdell ! Will commit a PR.

Yangqing avatar Mar 15 '17 03:03 Yangqing

Thanks @Yangqing @benbarsdell

terrychenism avatar Mar 15 '17 03:03 terrychenism

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)

PaulaQin avatar Jun 29 '17 06:06 PaulaQin