-
Notifications
You must be signed in to change notification settings - Fork 1.9k
Several issues with compiling Caffe2 on Mac OSX without GPU #24
Comments
This issue appears just by importing pycaffe in the alexnet notebook. Exception Type: EXC_CRASH (SIGABRT) Application Specific Information: |
(Adding @n3011 in case interested) |
Hi @AKSHAYUBHAT - could you let me know your opencv version? opencv_imgcodecs does not exist on my machine but I am using opencv 2, so I am wondering if it is a new target introduced in the new opencv 3 - in which case we should change the BREW file to support opencv3 as well. Regarding the protobuf: there is a flag to force the use of system protobuf: https://github.com/Yangqing/caffe2/blob/master/build_env.py#L18 Not sure if that solves your problem, but maybe give it a try? The whole build script is kind of experimental for now, so a bit cleaning might be needed. |
pkg-config --modversion opencv Regarding using system protobuf, I manually edited out the protobuf to force it to use system protobuf. Here is my edited caffe_python.cc Looking at following two issues It might be due to my system: |
I hope this one helps: https://github.com/Yangqing/caffe2/issues/25 |
Hi,
I have been trying to get Caffe 2 to work on Mac OSX without GPU/CUDA .
Here are the list of issues I have encountered.
The BREW files should have 'lopencv_imgcodecs'
I added following lines to register third party target and added "opencv_imgcoded" in each BREW file where opencv was used.
cc_thirdparty_target(
name="opencv_imgcodecs",
srcs=["BREW"],
commands=[],
cc_obj_files=["-lopencv_imgcodecs"],
)
This solved the linking issue and I was able to build.
After this even though I had specified non existing CUDA_DIR in build_env.py.
it did not detect and set following PYCAFFE2_CPU_ONLY correctly, resulting in cublas_2.h not found errors. I then went to caffe2_python.cc and manully commented out all portions that relied on #ifndef PYCAFFE2_CPU_ONLY.
With this I was able to build caffe2_python.cc .
Eventually all non GPU dependencies succeed except toy models.
[libprotobuf ERROR google/protobuf/descriptor_database.cc:57] File already exists in database: caffe/proto/caffe.proto
[libprotobuf FATAL google/protobuf/descriptor.cc:1018] CHECK failed: generated_database_->Add(encoded_file_descriptor, size):
libc++abi.dylib: terminating with uncaught exception of type google::protobuf::FatalException: CHECK failed: generated_database_->Add(encoded_file_descriptor, size):
Pycaffe+GPU is not available. Using CPU only version.
/bin/sh: line 1: 81061 Abort trap: 6 python generate_mnist_linear_classifier.py
This seems to be result of two copies of Protobuf being linked / mixed.
http://stackoverflow.com/questions/33017985/static-linking-with-generated-protobufs-causes-abort
I am now trying to edit BREW file to force it to use only the system protobuf.
The text was updated successfully, but these errors were encountered: