环境
* ubuntu 18.04
* cuda 9.1
* cudnn 7.1
* g++-4.8
caffe
-
下载源码
git clone https://github.com/BVLC/caffe.git
-
安装依赖
sudo apt-get install libatlas-base-dev ibsnappy-dev libopencv-dev
- 源码安装glog gflags lmdb libleveldb protocbuf2.6.1
# glog wget https://github.com/google/glog/archive/v0.3.3.tar.gz tar zxvf v0.3.3.tar.gz cd glog-0.3.3 ./configure make && make install # gflags wget https://github.com/schuhschuh/gflags/archive/master.zip unzip master.zip cd gflags-master mkdir build && cd build export CXXFLAGS="-fPIC" && cmake .. && make VERBOSE=1 make && make install # lmdb git clone https://github.com/LMDB/lmdb cd lmdb/libraries/liblmdb make && make install # libleveldb wget https://github.com/google/leveldb/archive/v1.19.tar.gz tar -xzf v1-1.19.tar.gz cd leveldb-1.19 make sudo mv out-static/libleveldb.* /usr/local/lib sudo mv out-share/libleveldb.* /usr/local/lib cd include sudo cp -R leveldb /usr/local/include sudo ldconfig #protocbuf tar -zxpvf protobuf-2.6.1.tar.gz; cd protobuf-2.6.1; ./configure && make && make install
*python
```
#$(caffe)/python
for req in $(cat requirements.txt); do pip install $req; done
```
-
编译
cp Makefile.config.example Makefile.config # Adjust Makefile.config (for example, if using Anaconda Python, or if cuDNN is desired) make all make test make runtest
-
环境变量
sudo vim ~/.bashrc #添加一行 export PYTHONPATH=/caffe所在的目录/python:$PYTHONPATH sudo source ~/.bashrc
faceboxes caffe
-
编译boost
./bootstrap.sh --with-python=python2 ./b2 sudo ./b2 install
-
编译caffe
make -j8 # Make sure to include $CAFFE_ROOT/python to your PYTHONPATH. make pycaffe make test -j8 # (Optional) make runtest -j8
bug
## 问题
ImportError: /usr/lib/x86_64-linux-gnu/libharfbuzz.so.0: undefined symbol: FT_Get_Var_Blend_Coordinates
## [解决](https://groups.google.com/forum/?nomobile=true#!topic/diffpy-users/86kXDfpOyoM)
conda install harfbuzz
## 问题
ImportError: /usr/lib/x86_64-linux-gnu/libpangoft2-1.0.so.0: undefined symbol: hb_font_funcs_set_variation_glyph_func
## [解决](https://stackoverflow.com/questions/40009184/error-importing-cv2-in-python3-anaconda)
conda install -c asmeurer pango
## 问题
ImportError: /usr/lib/x86_64-linux-gnu/librsvg-2.so.2: undefined symbol: pango_fc_font_map_set_config
## 解决
conda install pango
makefile(网盘)
####参考