Jupyter Notebookの利用(その2)
Jupyter Notebookの利用(2019/12/11更新)
(1) 計算ノードを一台占有し、Python仮想環境を作成し、pipでtensorflow-gpuとjupyterをインストール(一度、実施すればいい)。
[username@es3 ~]$ qrsh -g gaa12345 -l rt_F=1
[username@g0001 ~]$ module load python/3.6/3.6.5 cuda/10.0/10.0.130.1 cudnn/7.4/7.4.2
[username@g0001 ~]$ python3 -m venv ~/jupyter_env
[username@g0001 ~]$ source ~/jupyter_env/bin/activate
(jupyter_env)[username@g0001 ~]$ pip3 install tensorflow-gpu jupyter numpy==1.16.4
## 次回以降は、以下のようにモジュールの読み込みと~/jupyter_envのアクティベートだけでいい。
[username@es3 ~]$ qrsh -g gaa12345 -l rt_F=1
[username@g0001 ~]$ module load python/3.6/3.6.5 cuda/10.0/10.0.130.1 cudnn/7.4/7.4.2
[username@g0001 ~]$ source ~/jupyter_env/bin/activate
(jupyter_env)[username@g0001 ~]
(2) Jupyter Notebookを起動。
(jupyter_env)[username@g0001 ~]$ jupyter notebook --ip=`hostname` --port=8888 --no-browser
..
[I 20:41:12.082 NotebookApp] Use Control-C to stop this server and shut down all kernels (twice to skip confirmation).
[C 20:41:12.090 NotebookApp]
To access the notebook, open this file in a browser:
file:///home/username/.local/share/jupyter/runtime/nbserver-xxxxxx-open.html
Or copy and paste one of these URLs:
http://g0001.abci.local:8888/?token=token_string
or http://127.0.0.1:8888/?token=token_string
(3) 別ターミナルで。ローカルPCの8888番ポートを計算ノードの8888番ポートに転送するSSHトンネルを作成
yourpc$ ssh -L 8888:g0001:8888 -l username -p 10022 localhost
(4) ブラウザで下記のURLを開く(トークンは、(2)をコピペ)。
http://127.0.0.1:8888/?token=token_string
# Jupyter Notebook利用上の注意点(2019/12/11更新)
## notebookコンフィグファイル
Jupyter Notebookの利用には、notebookコンフィグファイルが必要です。
「jupyter_notebook_config.py」が下記のフォルダにない場合は、次のコマンドでnotebookコンフィグファイルを作成してください。
・ Windows: C:\Users\USERNAME\.jupyter\jupyter_notebook_config.py
・ OS X: /Users/USERNAME/.jupyter/jupyter_notebook_config.py
・ Linux: /home/USERNAME/.jupyter/jupyter_notebook_config.py
コメント
まだありません。
ログインしてコメントを書く