LoginSignup
8
9

More than 5 years have passed since last update.

windowsにkerasをインストールする

Last updated at Posted at 2016-05-02

windowsにpython用の深層学習ライブラリであるkerasをインストールする方法です。
pythonのバージョンは2.7の場合です。(試したのは64bit環境です。)

WinPythonのインストール

最新のWinPython2.7をダウンロード&インストールします。
https://sourceforge.net/projects/winpython/files/WinPython_2.7/

numpyとscipyのアップグレード

WinPythonには既にkerasがインストールされていますが、最新のKerasにアップグレードするために、まずnumpyとscipyをアップグレードします。ただし、pip install だとコンパイルが必要となり上手くいかないので、こちらからダウンロードしたwhlを利用します。

http://www.lfd.uci.edu/~gohlke/pythonlibs/#numpy
http://www.lfd.uci.edu/~gohlke/pythonlibs/#scipy

WinPython Command Prompt.exeを開いてダウンロードしたwhlをインストールします。こんな感じ。

pip install numpy-1.11.0+mkl-cp27-cp27m-win_amd64.whl
pip install scipy-0.17.0-cp27-none-win_amd64.whl

kerasのアップグレード

最後に、kerasをアップグレードします。Theanoもアップグレードされます。

pip install --upgrade keras

実行できるか確認

kerasのexampleファイルを取ってきて実行してみます。

wget --no-check-certificate https://raw.githubusercontent.com/fchollet/keras/master/examples/mnist_mlp.py
python mnist_mlp.py

問題なければ、Test accuracy:0.9856 などと出て終了します。

8
9
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
8
9