chainer 0,6,4,0,9,4,6,0 travis-ci python

A flexible framework of neural networks for deep learning

pypi GitHub license travis coveralls Read the Docs

Chainer: a neural network framework


Examples - Code examples - External examples - Research projects using Chainer

Social - Forum - Twitter - Join Slack - Forum (Japanese) - Twitter(Japanese) - Join Slack (Japanese)


Chainer is tested on Ubuntu 14.04 and CentOS 7. We recommend them to use Chainer, though it may run on other systems as well.

Minimum requirements: - Python 2.7.6+, 3.4.3+, 3.5.1+, 3.6.0+ - NumPy 1.9, 1.10, 1.11, 1.12 - Six 1.9

Requirements for some features: - CUDA support - CUDA 6.5, 7.0, 7.5, 8.0 - filelock - g++ 4.8.4+ - cuDNN support - cuDNN v2, v3, v4, v5, v5.1, v6 - Caffe model support - Protocol Buffers (pip install protobuf) - protobuf>=3.0.0 is required for Py3 - Image dataset support - Pillow - HDF5 serialization support - h5py 2.5.0 - Testing utilities - Mock - Nose


Minimum installation

If you use old setuptools, upgrade it:

pip install -U setuptools

Then, install Chainer via PyPI:

pip install chainer

You can also install Chainer from the source code:

python install

Installation with CUDA

If you want to enable CUDA, first you have to install CUDA and set the environment variable PATH and LD_LIBRARY_PATH for CUDA executables and libraries. For example, if you are using Ubuntu and CUDA is installed by the official distribution, then CUDA is installed at /usr/local/cuda. In this case, you have to add the following lines to .bashrc or .zshrc (choose which you are using):

export PATH=/usr/local/cuda/bin:$PATH
export LD_LIBRARY_PATH=/usr/local/cuda/lib64:$LD_LIBRARY_PATH

Chainer had chainer-cuda-deps module to enable CUDA in previous version. Recent version (>=1.3) does not require this module. So you do not have to install chainer-cuda-deps.

If you want to enable cuDNN, add a directory containing cudnn.h to CFLAGS, and add a directory containing to LDFLAGS and LD_LIBRARY_PATH:

export CFLAGS=-I/path/to/cudnn/include
export LDFLAGS=-L/path/to/cudnn/lib
export LD_LIBRARY_PATH=/path/to/cudnn/lib:$LD_LIBRARY_PATH

Do not forget to restart your terminal session (or source it) to enable these changes. And then, reinstall Chainer.

Image dataset support

If you want to use Image dataset (chainer/datasets/ImageDataset), please install Pillow manually. Supported image format depends on your environment.

pip install pillow

HDF5 Support

If you want to use HDF5 serialization, please install h5py manually. h5py requires libhdf5. Anaconda distribution includes this package. If you are using another Python distribution, use either of the following commands to install libhdf5 depending on your Linux environment:

apt-get install libhdf5-dev
yum install hdf5-devel

And then, install h5py via PyPI. You may need to install Cython for h5py.

pip install cython
pip install h5py

Multi-GPU Support

Multi-GPU training is supported by MultiprocessParallelUpdater. If you want to use MultiprocessParallelUpdater, please install NCCL by following the installation guide.

Run with Docker

We provide the official Docker image. Use nvidia-docker command to run Chainer image with GPU. You can login to the environment with bash, and run the Python interpreter.

$ nvidia-docker run -it chainer/chainer /bin/bash


Tokui, S., Oono, K., Hido, S. and Clayton, J., Chainer: a Next-Generation Open Source Framework for Deep Learning, Proceedings of Workshop on Machine Learning Systems(LearningSys) in The Twenty-ninth Annual Conference on Neural Information Processing Systems (NIPS), (2015) URL, BibTex



MIT License (see LICENSE file).

Related Repositories



Chainer implementation of "Perceptual Losses for Real-Time Style Transfer and Super-Resolution". ...



Chainer implementation of Deep Convolutional Generative Adversarial Network ...



karpathy's char-rnn ( implementation by Chainer ...



Object Detection with Faster R-CNN in Chainer ...



PSPNet in Chainer ...

Top Contributors

unnonouno beam2d okuta delta2323 takagi gwtnb wkentaro fukatani rezoo mitmul kashif yasunorikudo zori EdwardRaff cemoody kikusu KotaroSetoyama dsanno t-abe yuji-mizobuchi iwiwi tscohen hitottiez muupan jnory jnishi bkvogel kiyukuta anaruse tek1031


-   v1.16.0 zip tar
-   v1.15.0.1 zip tar
-   v1.15.0 zip tar
-   v1.14.0 zip tar
-   v1.13.0 zip tar
-   v1.12.0 zip tar
-   v1.11.0 zip tar
-   v1.10.0 zip tar
-   v1.9.1 zip tar
-   v1.9.0 zip tar
-   v1.8.2 zip tar
-   v1.8.1 zip tar
-   v1.8.0 zip tar
-   v1.7.2 zip tar
-   v1.7.1 zip tar
-   v1.7.0 zip tar
-   v1.6.2 zip tar
-   v1.6.1 zip tar
-   v1.6.0 zip tar
-   v1.5.1 zip tar
-   v1.5.0 zip tar
-   v1.4.1 zip tar
-   v1.4.0 zip tar
-   v1.3.2 zip tar
-   v1.3.1 zip tar
-   v1.3.0 zip tar
-   v1.2.0 zip tar
-   v1.1.2 zip tar
-   v1.1.1 zip tar
-   v1.1.0 zip tar