Chainer has become dependent on Cython and h5py since 1.5. How to install on Windows is described in Day 2 article (Installing Chainer 1.5.0 on Windows), but everyone is more I would like to add some supplements so that you can easily use Chainer properly on Windows.
** Note: As of 12/10/2015, Chainer (v1.5.1) does not officially support Windows. ** If you git clone and execute nosetest, you can see the reality that various functions are not actually working ...
--Preparing Windows
--Prepare a 64-bit Windows environment and a new NVIDIA GPU (option: if you want to use CUDA)
--Preparing Python
-Install Anaconda
--Compiler preparation
-Install Microsoft Visual C ++ Compiler for Python 2.7 (if you want to use Python2)
-Install Visual Studio Community 2013 (if you want to use CUDA, Python3.4)
-Install Visual Studio Community 2015 (if you want to use Python3.5)
--Preparation of CUDA (optional)
-Install CUDA Toolkit (7.5 is included in this article)
-Install cuDNN (optional)
--Chainer preparation
--pip install chainer
python -c "import chainer"
Chainer test
--python -c "import cupy"
CUDA test (optional)
--python -c "import cupy.cudnn"
cuDNN test (optional)First, CUDA only supports 7.0 to 64bit. If you want to use Chainer + CUDA environment, please use ** Python 64bit version **. If you only have a CPU, either is fine. H5py, which has become a dependent package from Chainer 1.5, is a little troublesome to install on 64bit Python. Considering various other circumstances, it is best to use the 64-bit version of Python 2.7 of ** Anaconda **. Both Python 2.7 and 3.4 can be used, so please choose according to your preference (3.5 is unconfirmed by the author).
If you want to use standard Python, there seems to be a way to use the package distributed at here. In particular, in the case of ** 64bit and non-Anaconda environment, be sure to install h5py ** before installing Chainer.
Chainer operation on cygwin has not been confirmed so far ...
Those who want to have fun preparing the compiler can be a little happy with the Python 2 system ...
For Python 2.7, please install Microsoft Visual C ++ Compiler for Python 2.7. Python finds this compiler in the registry, so you don't need to set environment variables, etc.
The required version of Visual Studio differs depending on the version of Python3. However, if you have the new Visual Studio installed, you can work around this specification by setting environment variables. Here, prepare the same one in consideration of the trouble when installing CUDA. The compiler available for both is Visual Studio Community 2013. Microsoft sites change addresses from time to time, so look for broken links (or have a suitable compiler).
If you include VS2013 Community, you need to set environment variables. Run set VS100COMNTOOLS =% VS120COMNTOOLS%
every time before pip install
, or set an environment variable.
Visual Studio Community 2015 is. Just install it and you're ready to go.
You need a Visual Studio compiler. If it is too new, CUDA's compiler nvcc will not work properly, so please refer to the manual and use the appropriate version. In this article, we will assume that you are using CUDA 7.5.
Please install Visual Studio Community 2013 as well as Python 3.4.
Add C: \ Program Files (x86) \ Microsoft Visual Studio 12.0 \ VC \ bin
to the environment variable PATH.
It's a waste not to use CUDA because you use Chainer. Download and install the CUDA Toolkit from the NVIDIA site.
cuDNN is a library that can perform the calculations required for NN at high speed and with low memory. Let's install it. After registering as a user at cuDNN, you will be able to download it within a few days. If you want to use Chainer right now, skip this step. Please note that you will need to reinstall Chainer after installing ** cuDNN ** (pip install chainer
after pip unisntall chainer
).
If you have successfully downloaded cuDNN, overwrite the extracted files with C: \ Program Files \ NVIDIA GPU Computing Toolkit \ CUDA \ v7.5
. For cuDNNv3, cudnn64_70.dll
is in the CUDA \ v7.5 \ bin
folder, cudnn.h
is in the CUDA \ v7.5 \ include
folder, and cudnn.lib
is in the CUDA \ v7. It's okay if it's in 5 \ lib \ x64
.
Launch the command line and see if you can use the nvcc
command.
Now let's install Chainer.
pip install chainer
If you cannot install or if various modules cannot be installed correctly, use the commands below.
pip install -U chainer -vvvv
In addition, it has been confirmed that infinite loops occur when cython, pip, and setuptools are old. Try updating those libraries to the latest version.
Execute the following command and check if import can be done without error.
--python -c "import chainer"
Chainer test
--python -c "import cupy"
CUDA test (optional)
--python -c "import cupy.cudnn"
cuDNN test (optional)
If the cupy import fails, try the following test again.
-- nvcc
Test if nvcc can be executed
If you want to check if the installation is correct, run pip uninstall chainer
multiple times until the chainer is gone, and then
Please install with pip install --no-cache -vvvv chainer
with cache disabled and debug display enabled.
If there is a problem with the installation, you should see an error log.
** chainer-cuda-deps
is no longer needed. Please do not install. ** **
-Is it possible to process natural language with chainer? Prepare the development environment with man windows -Unofficial tips for people who have trouble installing Chainer 1.5 -Install Chainer 1.5.0 on Windows
Recommended Posts