LoginSignup
2
3

More than 5 years have passed since last update.

Pylearn2のインストール手順

Last updated at Posted at 2016-03-06

概要

有名どころのPylearn2を使ってdeep learningを試そうと考え、以下のようにpipで簡単にインストールしたら http://qiita.com/dsanno/items/a1d805a89e192c44730d あたりをチュートリアルとしてやろうと思ったのですが、pipではインストールできませんでした。

pip install pylearn2

以下のページを参考にインストールできましたが、若干私の環境では異なるところがあったので、初心者向けに加筆したものをこちらに公開させていただきます。初心者向けですので、経験者は以下のページをご覧になったほうが早いと思います。

前提環境

  • MacBook 12 inch 2015年モデル
  • OS X 10.11 El Capitan
  • homebrewインストール済み
  • brew install pythonでpython2.7インストール済み
  • pipインストール済み

Pylearn2のインストール手順

TheanoをインストールしてからPylearn2をインストールする流れになります。

Theanoをインストール

Theanoの前提ソフトウェアをインストールします。

まずはgccから。

brew install homebrew/versions/gcc48
which gcc
ln -s /usr/local/bin/gcc-4.8 /usr/local/bin/gcc
which gcc
gcc --version
/usr/bin/gcc --version

次にPyYAMLなど。

pip install PyYAML
pip install IPython
pip install Cython
pip install NumPy
pip install SciPy

前提ソフトウェアの最後はPILです。

http://rakkyoo.net/?p=1266 を参考に
http://effbot.org/downloads/Imaging-1.1.7.tar.gz
をダウンロードして解凍したら、ディレクトリに移動してインストール。

cd Downloads/Imaging-1.1.7
python setup.py install

Theanoのインストールですが、以下のコマンドでは動かなかったので git clone からやりました。

pip install --upgrade --no-deps git+git://github.com/Theano/Theano.git

以下は、 git clone からの手順です。
http://deeplearning.net/software/theano/install.html#bleeding-edge-install-instructions
に書いてある手順ですけれども。

mkdir git
cd git/
git clone git://github.com/Theano/Theano.git
cd Theano/
python setup.py develop

最後にインポート出来ることを確認します。

python
import Theano

これでTheanoのインストールが完了しました。

Pylearn2インストール

いよいよPylearn2のインストールです。

cd git/
git clone git://github.com/lisa-lab/pylearn2.git
cd pylearn2/
python setup.py develop

インポート出来ることを確認します。

python
import pylearn2

最後に

あとは、データセットの準備などが必要なようですが、まだpylearn2を実際に使っていないので、残りは参考先のページのデータセットの準備からをご覧になると良いと思います。
http://deeplearning.jp/macbookにpylearn2をインストールする/

参考

http://deeplearning.jp/macbookにpylearn2をインストールする/
http://rakkyoo.net/?p=1266
http://deeplearning.net/software/theano/install.html#bleeding-edge-install-instructions

2
3
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
2
3