Requirements
Python Installation
|
|
Enable pyenv in your shell:
|
|
|
|
CUDA Installation
For Mac OS X, please see Setup GPU for Mac
|
|
OpenCV Installation
|
|
|
|
Issue fixed by export CPLUS_INCLUDE_PATH=$PY3_DIR/include/python3.6m
:
[ 73%] Building CXX object modules/python3/CMakeFiles/opencv_python3.dir/__/src2/cv2.cpp.o
/Users/John/Workspace/Fever/Vision/opencv/modules/python/src2/cv2.cpp:6:10: fatal error: 'Python.h' file not
found
#include <Python.h>
^
1 error generated.
Caffe
Installation
|
|
|
|
|
|
|
|
USE_CUDNN := 1
OPENCV_VERSION := 3
# brew install openblas
BLAS := open
BLAS_INCLUDE := $(shell brew --prefix openblas)/include
BLAS_LIB := $(shell brew --prefix openblas)/lib
# PYTHON_INCLUDE := /usr/include/python2.7 \
# /usr/lib/python2.7/dist-packages/numpy/core/include
ANACONDA_HOME := $(HOME)/.pyenv/versions/anaconda3-4.3.1
PYTHON_INCLUDE := $(ANACONDA_HOME)/include \
$(ANACONDA_HOME)/include/python3.6m \
$(ANACONDA_HOME)/lib/python3.6/site-packages/numpy/core/include
# ll /usr/local/lib/*boost*py*
PYTHON_LIBRARIES := boost_python3 python3.6m
# PYTHON_LIB := /usr/lib
PYTHON_LIB := $(ANACONDA_HOME)/lib
WITH_PYTHON_LAYER := 1
|
|
|
|
Issues
Issue, make pycaffe
:
Undefined symbols for architecture x86_64:
"boost::python::detail::init_module(PyModuleDef&, void (*)())", referenced from:
_PyInit__caffe in _caffe-57cf03.o
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
make: *** [python/caffe/_caffe.so] Error 1
Solution:
|
|
Issue, import caffe
:
>>> import caffe
Failed to include caffe_pb2, things might go wrong!
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/Users/John/Workspace/Fever/DeepLearning/caffe/python/caffe/__init__.py", line 4, in <module>
from .proto.caffe_pb2 import TRAIN, TEST
File "/Users/John/Workspace/Fever/DeepLearning/caffe/python/caffe/proto/caffe_pb2.py", line 6, in <module>
from google.protobuf.internal import enum_type_wrapper
ModuleNotFoundError: No module named 'google'
Solution:
|
|
# https://anaconda.org/anaconda/protobuf/files
$ conda install protobuf
Fetching package metadata .........
Solving package specifications: .
UnsatisfiableError: The following specifications were found to be in conflict:
- protobuf -> python 2.7* -> openssl 1.0.1*
- python 3.6*
Use "conda info <package>" to see the dependencies for each package.
Others
How display dependencies:
|
|
TensorFlow
Installation
|
|
|
|
Issues
Issue, import tensorflow
:
>>> import tensorflow as tf
I tensorflow/stream_executor/dso_loader.cc:135] successfully opened CUDA library libcublas.8.0.dylib locally
I tensorflow/stream_executor/dso_loader.cc:135] successfully opened CUDA library libcudnn.5.dylib locally
I tensorflow/stream_executor/dso_loader.cc:135] successfully opened CUDA library libcufft.8.0.dylib locally
Segmentation fault: 11
Solution:
|
|
Issue, “Library not loaded: @rpath/libcublas.8.0.dylib”:
ImportError: dlopen(/Users/John/.pyenv/versions/anaconda3-4.3.1/lib/python3.6/site-packages/tensorflow/python/_pywrap_tensorflow_internal.so, 10): Library not loaded: @rpath/libcublas.8.0.dylib
Solution: Disbale SIP
Reboot into “Recovery OS”,
|
|
Restart into macOS,
|
|