caffe安装问题总结

错误提示:

python/caffe/_caffe.cpp:1:52: fatal error: Python.h: No such file or directory

 #include   // NOLINT(build/include_alpha)

遇到此类问题基本是caffe找不到python,因此在make py之前反复确认下anaconda或python所在目录是否存在。

解决:

使用anaconda2-4.0.0安装时,Makefile.config的配置文件里

ANACONDA_HOME := $(HOME)/anaconda
而anaconda安装时,默认安装在anaconda2文件夹里,因此这里要修改为

ANACONDA_HOME := $(HOME)/anaconda2

在anaconda2-4.1.1中修复了这个问题,因此选择anaconda2-4.1.1较好。


错误提示

No module named google.protobuf.internal

解决:

sudo chmod 777 -R anaconda2

conda install protobuf






Using Anaconda Cloud api site https://api.anaconda.org
Fetching package metadata: ....
Solving package specifications: .........

Package plan for installation in environment /home/cb/anaconda2:

The following packages will be downloaded:

    package                    |            build
    ---------------------------|-----------------
    sqlite-3.13.0              |                0         4.0 MB
    libprotobuf-3.0.0          |                0         6.0 MB
    python-2.7.12              |                1        12.1 MB
    conda-env-2.5.1            |           py27_0          26 KB
    ruamel_yaml-0.11.14        |           py27_0         352 KB
    conda-4.1.11               |           py27_0         201 KB
    protobuf-3.0.0             |           py27_0         407 KB
    ------------------------------------------------------------
                                           Total:        23.0 MB

The following NEW packages will be INSTALLED:

    libprotobuf: 3.0.0-0       
    protobuf:    3.0.0-py27_0  
    ruamel_yaml: 0.11.14-py27_0

The following packages will be UPDATED:

    conda:       4.0.5-py27_0 --> 4.1.11-py27_0
    conda-env:   2.4.5-py27_0 --> 2.5.1-py27_0  
    python:      2.7.11-0     --> 2.7.12-1      
    sqlite:      3.9.2-0      --> 3.13.0-0      

Proceed ([y]/n)? y

Fetching packages ...
sqlite-3.13.0- 100% |################################| Time: 0:06:34  10.58 kB/s
libprotobuf-3. 100% |################################| Time: 0:03:03  34.42 kB/s
libprotobuf-3. 100% |################################| Time: 0:10:45   9.79 kB/s
python-2.7.12- 100% |################################| Time: 0:06:02  34.89 kB/s
conda-env-2.5. 100% |################################| Time: 0:00:02   9.67 kB/s
ruamel_yaml-0. 100% |################################| Time: 0:00:40   8.89 kB/s
conda-4.1.11-p 100% |################################| Time: 0:00:25   8.08 kB/s
protobuf-3.0.0 100% |################################| Time: 0:00:24  17.01 kB/s
Extracting packages ...
[      COMPLETE      ]|###################################################| 100%
Unlinking packages ...
[      COMPLETE      ]|###################################################| 100%
Linking packages ...
[      COMPLETE      ]|###################################################| 100%
c

你可能感兴趣的:(caffe)