Chainer environment creation procedure memo on Windows (mainly a memorandum on handling errors)
Chainer: A flexible framework for neural networks
※Caution! In my environment, I could not create an execution environment for the GPU version (CUDA version), so please refer to it for the CPU version.
If you want to use CUDA with Chainer, be sure to install CUDA Toolkit
first.
CUDA Toolkit | NVIDIA Developer
Example: Select [Download] => [Windows] => [x86_64] => [10] => [exe (network)].
Install Chainer.
$ pip install chainer
master
. (If the version does not match, an error may occur)pfnet/chainer: A flexible framework of neural networks for deep learning
Normal execution
$ python examples/mnist/train_mnist.py
TODO: In my environment, I get an error at runtime, so I'm verifying => Even if I imitate another person's article and make trial and error, I am giving up because I can not detect the headers of CUDA by any means ... (v1.21.0).
If the installation is successful, you should be able to do the following:
Execution using gpu
$ python train_mnist.py -g 0
NOTE: This error did not occur in an environment where Visual Studio 2015 was already installed.
When I tried to install with pip, I got the following error.
Running chainer installation with pip failed
$ pip install chainer
Using cached chainer-1.10.0.tar.gz
Complete output from command python setup.py egg_info:
running egg_info
creating pip-egg-info\chainer.egg-info
writing top-level names to pip-egg-info\chainer.egg-info\top_level.txt
writing dependency_links to pip-egg-info\chainer.egg-info\dependency_links.txt
writing pip-egg-info\chainer.egg-info\PKG-INFO
writing requirements to pip-egg-info\chainer.egg-info\requires.txt
writing manifest file 'pip-egg-info\chainer.egg-info\SOURCES.txt'
warning: manifest_maker: standard file '-c' not found
error: Microsoft Visual C++ 14.0 is required. Get it with "Microsoft Visual C++ Build Tools": http://landinghub.visualstudio.com/visual-cpp-build-tools
Executing cythonize
Options: {'annotate': False, 'no_cuda': False, 'profile': False, 'linetrace': False}
**************************************************
*** WARNING: nvcc not in path.
*** WARNING: Please set path to nvcc.
**************************************************
Include directories: []
Library directories: []
----------------------------------------
Command "python setup.py egg_info" failed with error code 1 in C:\Users\<username>\AppData\Local\Temp\pip-build-7ak65o9t\chainer\
Apparently there is no compiler for Cython, so it seems to be useless, so install Microsoft Visual C ++ Build Tools
, which is also specified in the error log, first. (I think it depends on the environment, but it took a long time to install. About 30 minutes?)
Download the Visual C++ Build Tools (standalone C++ compiler, libraries and tools)
You should now be able to install it by running it again.
As I wrote above, I got this error when the installed Chainer version and the sample version do not match.
In my case I used master
when using chainer 1.21.0
and got this error.
As a workaround, I checked out the 1.21.0
tag and used the sample for that version and it worked fine.
The following error may occur when installing chainer.
**************************************************
*** WARNING: Include files not found: ['cublas_v2.h', 'cuda.h', 'cuda_profiler_api.h', 'cuda_runtime.h', 'curand.h']
*** WARNING: Skip installing cuda support
*** WARNING: Check your CFLAGS environment variable
**************************************************
TODO: Currently unsolved in my environment ... In other people's articles, there was a description such as adding a path to INCLUDE, so I tried adding it, but it did not solve.
**************************************************
*** WARNING: Include files not found: ['cudnn.h']
*** WARNING: Skip installing cudnn support
*** WARNING: Check your CFLAGS environment variable
**************************************************
Chainer MNIST Error AttributeError: 'module' object has no attribute 'PlotReport' Install Chainer + CUDA 8.0 on Windows 10-Qiita
Recommended Posts