Caffe Python Install Windows
Note that in order to build the caffe python wrappers you must install boost using the –with-python option: brew install -build-from-source -with-python -fresh -vd boost Note that Homebrew maintains itself as a separate git repository and making the above brew edit FORMULA changes will change files in your local copy of homebrew’s master branch.
Document your code
Every project on GitHub comes with a version-controlled wiki to give your documentation the high level of care it deserves. It’s easy to create well-maintained, Markdown or rich text documentation alongside your code.
Sign up for free See pricing for teams and enterprisesThe official installation instructions explain the recommended steps for installing on the official platforms of CentOS 7.3.
These unofficial instructions collect tips and guides but without any guarantees. Please add any missing details and correct any mistakes.
Conda Package Installation
- Install bzip2
- Install miniconda / anaconda (https://conda.io/miniconda.html / https://www.anaconda.com/download/)
- conda install -c intel caffe
- run IntelCaffe: ${PREFIX}/bin/caffe, where ${PREFIX} is the root installation directory of miniconda or anaconda.
Docker
- Please follow the instructions (https://github.com/intel/caffe/tree/master/docker)
- Note that you may need to specify proxy in Dockerfile (e.g., docker/standalone/cpu-ubuntu/Dockerfile)
Linux
- Source Installation: Install and build from source and run performance benchmarks (https://github.com/intel/caffe/wiki/Install-Intel-Caffe)
- Ubuntu 14.04/Cuda 7 for EC2: AMI and installation script that works on EC2 g2.2xlarge and g2.8xlarge instances.
- Ubuntu 14.04 VirtualBox VM: virtual machine installation with CUDA 6.5 and system Python.
- Ubuntu 14.04 ec2 instance: ec2 installation with CUDA 6.5 and video walkthrough plus a vagrant VM. (Needs update for latest Caffe).
- Super computing cluster without root access (GPU+CPU): Cuda 6.5, cuDNN V1, Python 2.7.x
OS X
See the official instructions.
Windows
There is an unofficial Windows port of Caffe at niuzhiheng/caffe:windows. Thanks @niuzhiheng!
Caffe Python Version
Another unofficial Windows port of Caffe at [redknightlois/caffe] (https://github.com/redknightlois/caffe). This port is based on work done by @initialneal. Binary packages to compile available at: https://initialneil.wordpress.com/2015/01/11/build-caffe-in-windows-with-visual-studio-2013-cuda-6-5-opencv-2-4-9/
Yet another unofficial Windows port can be found at willyd/caffe. Unlike the previous ports this one builds on top of the CMake build. A super-build project that downloads and builds all Caffe dependencies is also available at willyd/caffe-builder.
See https://github.com/intel/caffe/wiki/Run-benchmark
Clone this wiki locally
I have been using this resource to install caffe on my Windows 10 system.
I started by installing the necessary dependencies for Python via the command prompt:
I then created an empty directory called caffe
in my C:
directory. I then went into that directory via the command prompt and typed the following commands:
I then opened the file build_win.cmd
in the /scripts
directory and edited a few things. My file after editing looks like this:
After this, I ran the following command:
This gave me the following output:
I am particularly puzzled by these statements:
How are these files not being detected in my system when build_win.cmd
clearly contains this line:
The relevant python files are also present in my system. PythonLibs
, which the .cmd
file is unable to find, is present in the Anaconda3
directory.
Numpy
is also present in one of the sub-directories of that directory.
I can even run python directly from the command line:
At this point, I have no I idea why I am getting errors about numpy and Python libraries. Please let me know if you have any suggestions.
EDIT:
I ran the following command in my project directory after watching this video:
The output was as follows:
Does this mean I'll have to switch to Python 3.5 to use this framework?
EDIT:
I downloaded python 3.5.5
, performed the same steps as above and got the same errors.
I thought about CristiFati's suggestion more and executed the following command:
This gave me the following output:
I now understand that the problem is being caused by the executable of Python 2.7 being used for compilation. How can I make the build script point to python 3.5?
EDIT:
I ran the cmake command correctly as shown below but I am now seeing new errors.
Pip Install Caffe Python
It is giving me these errors:
1 Answer
cmake has 'standard' ways locate external packages installations (via scripts). This applies to Python. When such a package is found there are some variables that are set, typically:
${PACKAGE}_FOUND=ON
(package status flag)${PACKAGE}_INCLUDE_DIRS
(include directories - used at compile time)${PACKAGE}_LIBRARIES
(libraries - used at link time)
When searching for numpy ([GitHub]: BVLC/caffe - (windows) caffe/cmake/Modules/FindNumPy.cmake), PythonInterp (standard cmake module) is searched (and used). As noticed in the initial output:
python 2.7 (which doesn't have the numpy module installed) was detected, leading to numpy finding failure.
Install Caffe Mac
Looking at FindPythonInterp.cmake script I noticed that it sets (among others) the ${PYTHON_EXECUTABLE} (cmake) variable.
Setting that variable 'manually' to cmake (by passing a cmdline argument), would be the next logical thing (as I didn't know if this alone was enough, I just added a comment):
Note: Do not mix Cygwin and native Win tools, as you might run into subtle problems.
CristiFatiCristiFati