Win10+VS2015+Anaconda3 (GPU)+Caffe installation (TensorFlow has been installed before)

I installed TensorFlow before and recently needed Caffe for learning. I don't know if the two can be installed at the same time, so Google solved it and spent a day digging holes. Fortunately, it was finally successfully installed.

1. Software download

1) VS2015 Community Edition

2)Anaconda3-4.2.0-Windows-x86_64(python3.5)

3) Cuda8.0 ( Cuda7.5 corresponds to VS2013)

4)cudnn-8.0-windows10-x64-v5.0

5) Caffe download URL   (caffe-master only supports VS2013 , and the Windows toolkit (caffe-windows) provided by caffe provides support for VS2015 )

Second, installation and compilation

1. Create a folder project in the D drive, open CMD, and enter project. Obtain caffe on the command line, or extract the downloaded "caffe-windows" zip file to the D:\project folder and compile it. As shown



2. If there is an error, we need to change the build_win.cmd file

1) The first place:

Change it to:


2) Second place:


Change it to:


3) The third place


Change it to:



3. Press shift and right mouse button under D:\project\caffe\scripts file to open the powershell window, drag build_win.cmd into the window and press Enter to compile, it will appear in the download " libraries_v140_x64_py27_1.1.0.tar.bz2 " dependency package, this is very Difficult to download through the command window . It is better to download directly from the Internet and recommend a URL (click) . and unzip it into the dependencies folder:



4. Open WindowsDownloadPrebuiltDependencies.cmake with Notepad++ in D:\project\caffe\cmake, delete the following code to avoid downloading the " libraries_v140_x64_py27_1.1.0.tar.bz2 " dependency package again :



5. Compile " build_win.cmd " again for about half an hour:


Generate the Caffe.sln file in the "D:\project\caffe\build" folder:



6. Compile the Caffe.sln file in VS2015

After setting Debug and Release to compile ALL_BUILD successfully, note that they are all x64.


Compilation succeeded:



If you have completed this step, then congratulations, the Caffe configuration is successful.


3. Configure the Python interface

Open Anaconda Prompt and enter the following to install the package file, it will take some time.

conda config --add channels conda-forge
conda config --add channels willyd
conda install --yes cmake ninja numpy scipy protobuf==3.1.0 six scikit-image pyyaml pydotplus graphviz


In the process again, the configuration may be terminated for some reason. At this time, we have to use this command several times:

conda install --yes cmake ninja numpy scipy protobuf==3.1.0 six scikit-image pyyaml pydotplus graphviz

Final Results:


After the compilation is successful, add "D:\project\caffe\python" to the environment variable, and copy the caffe folder under this path to the site_packages directory where Anaconda is installed, which is C:\Users\T on my computer ***\Anaconda3\Lib\site-packages

After completing the above operations, the configuration is complete. Let's test it~

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=325818639&siteId=291194637