0
0

More than 5 years have passed since last update.

WSL(openSUSE Leap 42.2)上へのNNABLA導入 HOWTO

Last updated at Posted at 2017-11-12

とりあえず、導入部分のみメモ書き.
Windows 10 Home Edition, version 1709 で検証済みです。

0)準備

Windows Store からopenSUSE on WSLを導入。
(検索窓からWSLと入れて、openSUSE Leap 42 を選択、ダウンロード)

初めに起動するとコンソールに次のような文字列が表示されてくるので、WSLアイコンから自動ログインする際のユーザー名とパスワードを入力、完了するとWSLコマンドラ
インシェル(bash)にアクセスできます。

WSL
Installing, this may take a few minutes…
Installation successful!
Please create a default UNIX user account. The username does not need to match your Windows username.
For more information visit: https://aka.ms/wslusers
Enter new UNIX username: dokata1
New password:
BAD PASSWORD: it is too short     #簡単すぎるパスワードは怒られます
BAD PASSWORD: is too simple
Retype new password:
passwd: password updated successfully
Use same password for root user?
Type "y" to approve, any other key to reject: y    #注
Default UNIX user set to: dokata1
dokata1@DSUB:~>
  • 11行目 Use same password for root user? の部分、セキュリティ強化の観点からは[n]を入力して別のパスワードを設定しておいた方がよい。ここでは[y]としてスキップし、rootパスワード=管理者のパスワードとして運用する。この"root"はWindowsで言う管理者そのものとは異なる。

1)Requirements

システムアップデートをおこなった上で、nnablaインストール時に必要となるパッケージを導入しておきます。

WSL
dokata1@DSUB:~> sudo zypper update
dokata1@DSUB:~> sudo zypper install python-pip python-devel
dokata1@DSUB:~> which python
/usr/bin/python
dokata1@DSUB:~> ls -l /usr/bin/python
lrwxrwxrwx 1 root root 9 Sep 15 21:35 /usr/bin/python -> python2.7
  • python-devel はnnableのビルド時に必要。ないとインストール失敗する
  • python3を使う場合は次の通り(3.xの部分は適宜書き換える)

dokata1@DSUB:~> sudo zypper install python3 python3-pip python3-devel
#……(省)……
dokata1@DSUB:~> pip --version
pip 7.1.2 from /usr/lib/python3.4/site-packages (python 3.4)
#python本体のバージョン参照は変わっていないためlnでリンクを張り替える
dokata1@DSUB:~> python --version
Python 2.7.13
dokata1@DSUB:~> sudo ln -sf /usr/bin/python3.4 /usr/bin/python
dokata1@DSUB:~> python --version
Python 3.4.6

2)インストール

nnabla 関連ライブラリ・ツールをpythonパッケージとして導入します。併せて、データ分析に便利なjupyter-notebookも入れておきましょう。ここではtensorflowもインストールしていますが、そのほかの深層学習フレームワークであってもWSL上のpipから導入して利用できます。

dokata1@DSUB:~> sudo pip install --upgrade pip
#...省略
Successfully installed pip-9.0.1
dokata1@DSUB:~> sudo pip install -U nnabla jupyter tensorflow
Collecting nnabla
  Downloading nnabla-0.9.5-cp34-cp34m-manylinux1_x86_64.whl (7.0MB)
    100% |████████████████████████████████| #…….その他長いので省略
Successfully installed Cython-0.25.2 MarkupSafe-1.0 PyWavelets-0.5.2 backports-abc-0.5 bleach-2.1.1 certifi-2017.11.5 chardet-3.0.4 contextlib2-0.5.5 cycler-0.10.0 decorator-4.1.2 entrypoints-0.2.3 enum34-1.1.6 futures-3.1.1 h5py-2.7.1 html5lib-0.9999999 idna-2.6 ipykernel-4.6.1 ipython-6.2.1 ipython-genutils-0.2.0 ipywidgets-7.0.4 jedi-0.11.0 jinja2-2.10 jsonschema-2.6.0 jupyter-1.0.0 jupyter-client-5.1.0 jupyter-console-5.2.0 jupyter-core-4.4.0 markdown-2.6.9 matplotlib-2.1.0 mistune-0.8.1 nbconvert-5.3.1 nbformat-4.4.0 networkx-2.0 nnabla-0.9.5 notebook-5.2.1 numpy-1.13.3 olefile-0.44 pandocfilters-1.4.2 parso-0.1.0 pexpect-4.3.0 pickleshare-0.7.4 pillow-4.3.0 prompt-toolkit-1.0.15 protobuf-3.4.0 ptyprocess-0.5.2 pygments-2.2.0 pyparsing-2.2.0 python-dateutil-2.6.1 pytz-2017.3 pyzmq-16.0.3 qtconsole-4.3.1 requests-2.18.4 scikit-image-0.13.1 scipy-1.0.0 setuptools-36.7.1 simplegeneric-0.8.1 six-1.11.0 tensorflow-1.4.0 tensorflow-tensorboard-0.4.0rc2 terminado-0.6 testpath-0.3.1 tornado-4.5.2 tqdm-4.19.4 traitlets-4.3.2 typing-3.6.2 urllib3-1.22 wcwidth-0.1.7 werkzeug-0.12.2 wheel-0.30.0 widgetsnbextension-3.0.7
dokata1@DSUB:~>
dokata1@DSUB:~> jupyter --version
4.4.0
  • Linux上でのpython開発環境と同様に動作することを最も簡単なデモで確認済みですが、開発過程でWSLの仕様による制約が出てくるかも知れません。今後検証していきます。

3)後でrefを足します

0
0
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
0
0