Skip to content
forked from chainer/chainer

A flexible framework of neural networks for deep learning

License

Notifications You must be signed in to change notification settings

truongdo/chainer

 
 

Repository files navigation

Problem

Not found cupy

python
import chainer.cuda
cuda.cupy

If you have a problem with the above messages, try to run import cupy to know more detail about the error, it might not caused by cupy is not present, but is because cuda is not initialized correctly, for example, some *.so is not found. The common mistake is CUDA lib path is not included in LD_LIBRARY_PATH.

"sudo apt-get install libhdf5-dev" export CFLAGS=-I/usr/include/hdf5/serial cd /usr/lib/x86_64-linux-gnu sudo ln -s libhdf5_serial.so.8.0.2 libhdf5.so sudo ln -s libhdf5_serial_hl.so.8.0.2 libhdf5_hl.so

pypi pypi GitHub license travis coveralls

Chainer: a neural network framework

Requirements

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.0+
  • NumPy 1.9
  • Six 1.9
  • h5py 2.5.0

Requirements for some features:

  • CUDA support
    • CUDA 6.5, 7.0, 7.5
    • filelock
    • g++
  • cuDNN support
    • cuDNN v2, v3
  • Caffe model support
    • Python 2.7.6+ (Py3 is not supported)
    • Protocol Buffers (pip install protobuf)
  • Testing utilities
    • Mock
    • Nose

Installation

Chainer requires libhdf5 via h5py. 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

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 setup.py install

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 CPATH, and add a directory containing libcudnn.so to LIBRARY_PATH and LD_LIBRARY_PATH:

export CPATH=/path/to/cudnn/include:$CPATH
export LIBRARY_PATH=/path/to/cudnn/lib:$LIBRARY_PATH
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.

Reference

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

More information

License

MIT License (see LICENSE file).

About

A flexible framework of neural networks for deep learning

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Python 97.2%
  • C 1.4%
  • Other 1.4%