Description and summary of what you need to install Chainer on Mac

This article is a continuation of Building a python environment for artificial intelligence (Chainer / TensorFlow / CSLAIER).

table of contents

  1. Purpose of the article
  2. My development environment
  3. Precautions for installation
  4. Install Chainer

Purpose of the article

In this article, we will install Chainer, a popular artificial intelligence library in Japan. I installed it myself, and there were many things I didn't understand, so I summarized what I investigated. I hope it will be helpful for those who install Chainer from now on.

Writer's development environment

・ MacBook Pro (Retina, 13inch, Early 2015) · MacOS Sierra (version 10.12.2) ・ Processor (2.7 GHz Intel Core i5) · Memory (8 GB 1867 MHz DDR3) · Graphics (Intel Iris Graphics 6100 1536 MB)

-Homebrew, pyenv, anaconda2-4.2.0 / anaconda3-4.2.0 are assumed to be installed. If you do not have it installed, please read Building a python environment for artificial intelligence (Chainer / TensorFlow / CSLAIER).

Precautions for installation

If you look at Chainer's git, all you need to use Chainer is

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

Requirements for some features( Requirements for some functions): ・ 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 ・ 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

(Git can download the source code, and at the bottom of the page you will find what you need to use the library and how to use it easily, so it will be helpful when you use it for the first time). I thought it was hard because it was something I had hardly heard of, but because "Python", "Numpy", and "Six", which are necessary to execute the minimum functions, are included in anaconda. , No need to install.

Also, "g ++", which is a requirement for some functions, is installed from the beginning on Mac. "Filelock", "Pillow", "h5py", and "Nose" are also included in anaconda, so there is no need to newly install them.

Numpy Numpy is an extension module for efficient numerical calculation in python.

"How to use NumPy-programming bulletin" http://programming.blogo.jp/python/numpy/introduction

When training artificial intelligence, I do matrix calculations, You can use Numpy to make calculations very smoothly.

Six Six is a package to absorb the difference between python 2 series and 3 series. For example, even if there are libraries with different names in the 2nd and 3rd series, you can use them with the same name by installing them via Six.

"Library Six for writing version-neutral code in Python" http://momijiame.tumblr.com/post/67465721521/python-%E3%81%A7%E3%83%90%E3%83%BC%E3 % 82% B8% E3% 83% A7% E3% 83% B3% E3% 83% 8B% E3% 83% A5% E3% 83% BC% E3% 83% 88% E3% 83% A9% E3% 83 % AB% E3% 81% AA% E3% 82% B3% E3% 83% BC% E3% 83% 89% E3% 82% 92% E6% 9B% B8% E3% 81% 8F% E3% 81% 9F % E3% 82% 81% E3% 81% AE% E3% 83% A9% E3% 82% A4% E3% 83% 96% E3% 83% A9% E3% 83% AA-six

CUDA CUDA (pronounced CUDA) is a comprehensive development environment for GPU computers provided by NVIDIA. GPU (abbreviation of graphical processing unit, specializing in image processing, good at processing simple and huge data, CPU is good at continuous calculation, but GPU is good at parallel calculation) and CUDA For more information, please refer to the following site.

"GPU computing starting from scratch" http://www.gdep.jp/page/view/248

filelock filelock is for exclusive control. Exclusive control means that when a conflict occurs with a shared resource that can be used by multiple processes when the program is executed, if one process uses the resource exclusively, another process uses it. Do not allow.

"Exclusive control is" lock "(lock): -IT terminology binary" http://www.sophia-it.com/content/%E6%8E%92%E4%BB%96%E5%88%B6%E5%BE%A1

g++ What is g ++?

A C ++ compiler included with GNU's GCC.

I didn't understand what it was. GNU is read as Gnu, and it seems to be an OS (short for operating system, software for running computers) and a wide collection of computer software.

GCC is a compiler developed and published by GNU Project (a general term for development projects of UNIX compatible software groups). ..

Is it that an organization trying to popularize free software is making an OS called GNU that is compatible with UNIX and compiling it (making human-written code readable by computers)?

「g++」 http://kaworu.jpn.org/cpp/g++

cuDNN cuDNN is a GPU-optimized library provided by a company called NVIDIA for DNN (Deep Neural Network) development.

Deep learning is simple, but it takes a lot of time with a CPU because it performs a huge amount of calculations, and in some cases it hardly progresses. I think it's okay if you think that deep learning can be done faster than the CPU.

"GTC 2015 --CUDA library" cuDNN "for deep learning" http://news.mynavi.jp/articles/2015/04/10/gtc2015_cudnn/

Protocol Buffers This article was very straightforward about Protocol Buffers.

"I searched for Protocol Buffers." http://qiita.com/aiueo4u/items/54dc5dd8c4772253634c

Pillow Pillow is a python image processing library that can process a large number of images at once. By the way, there is a similar one called PIL, but since this does not support pyhton3 series, Pillow is often used.

In order to learn artificial intelligence, it is necessary to load a large number of images, but the images to be loaded must be the same size, or the images are processed to increase the number of images. This library is convenient in such a case.

"How to use the Python 3.5 compatible image processing library Pillow (PIL)" https://librabuch.jp/blog/2013/05/python_pillow_pil/

h5py Is it a library for using the file format HDF5?

If this prevents Chainer from installing, take a look at this article.

"Unofficial tips for people who have trouble installing Chainer 1.5" http://qiita.com/unnonouno/items/c491b6df59352159cbf0

Mock I think it's good to think that it is used when testing software.

"Exploring Moq-Part 1-: What is Moq? What is Mock? And Mock Generation #adcjcs" http://blogs.wankuma.com/masaru/archive/2010/12/03/195469.aspx

Nose I think Nose is a test execution environment.

"I wrote a unit test with Python nose" http://blog.chocolapod.net/momokan/entry/8

Install Chainer

The minimum requirements are already installed, so immediately Let's install Chainer.

Install Chainer


$ pip install chainer

pip is a python package management tool. pip is already in anaconda, so you don't need to install it again. By installing Chainer with pip, you can install Chainer in the environment of the python version you are currently using.

The installed Chainer is in User / your_name / .pyenv / versions / anaconda2-4.2.0 / lib / python2.7 / site-packages / chainer.

You have now installed Chainer. Next time, I will install CSLAIER, which allows machine learning to be performed with a GUI (graphical user interface).

Recommended Posts

Description and summary of what you need to install Chainer on Mac
What to do if `pip install matplotlib` fails on Mac
How to install mysql-connector-python on mac
Install OpenCV and Chainer on Ubuntu
Install CUDA 8.0 and Chainer on Ubuntu 16.04
Steps to install matplotlib on Mac
How to install OpenCV on Mac
Steps to install python3 on mac
I want to know if you install Python on Mac ・ Iroha
Install Anaconda on Mac and upload Jupyter (IPython) notebook to Anaconda Cloud
How to install drobertadams / toggl-cli on Mac
How to build a beautiful Python environment on a new Mac and install Jupter Notebook
Until you install Anaconda for data analysis on your Mac and launch the IDE
How to install and use pyenv, what to do if you can't switch python versions
Install Python3 on Mac and build environment [Definitive Edition]
What to do if you can't pip install mysqlclient
Install selenium on Mac and try it with python
Steps to install the latest Python on your Mac
Very easy to install SciPy on Mac OS X
Jetson Nano (B01) initial setup and what you need
I tried to install scrapy on Anaconda and couldn't
Install Tensorflow on Mac
Install pyenv on mac
Install Ansible on Mac
Install Python on Mac
Install Python 3 on Mac
Install Chainer 1.5.0 on Windows
Install Python 3.4 on Mac
Install Caffe on Mac
Install mecab on mac
Install Chainer on CentOS 6.7
Install mecab-python on Mac
Use Python to monitor Windows and Mac and collect information on the apps you are working on
Summary of things that need to be installed to run tf-pose-estimation
[python] Summary of how to retrieve lists and dictionary elements
[Python] Summary of how to use split and join functions
Install pyenv on MacBook Air and switch python to use
Summary of yum packages required for pip install on EC2
What to do if you can't use WiFi on Linux
What to do if pip install mysqlclient fails on MacOS
How to install Theano on Mac OS X with homebrew
You may need git to install the jupyter lab extension
Summary of Differences Between Ruby on Rails and Django ~ Basics ~
List of things you might need to do to develop OBD Linux on Raspberry Pi with Buildroot
What to do if you get the message "" ~ .pkg "is corrupted and cannot be opened" when installing wxPython on Mac OS X
2017.3.6 ~ 3.12 Summary of what we did
Install pygame on python3.4 on mac
Install module on Anaconda (Mac)
Install OpenPose on mac (Catalina)
Install numba on your Mac
Handling of python on mac
Update python on Mac to 3.7-> 3.8
Install pandas 0.14 on python3.4 [on Mac]
Install Chainer 1.6 (GPU) on Windows 7.
Install Django on your Mac
Install pillow on Mac OSX 10.9
[Mac] Tips: Install pyquery on Mac [pyquery]
Catalina on Mac and pyenv
[Python] [Chainer] [Windows] Install Chainer on Windows
How to install OpenCV on Cloud9 and run it in Python
A note on what you did to use Flycheck with Python