Install方法
通常のjupyter notebook
以下はdocker コンテナを用いたInstall方法となります。 以下は、コンテナ内の8888ポートを、外部に10000ポートで公開しています。 ブラウザから、127.0.0.1:10000でJupyter notebookにアクセスできます。
sudo docker run -p 10000:8888 --name jupyter jupyter/scipy-notebook
tensorflowが入ったjupyter notebook
docker pull tensorflow/tensorflow:latest # Download latest stable image docker run -it -p 8888:8888 tensorflow/tensorflow:latest-jupyter # Start Jupyter server
利用方法
モジュールをIntallするとき
外部からモジュールをInstallする際は、以下のようにコマンドの前に!を記述する。
!pip install tensorflow
pipでモジュールをInstallする場合のproxyの回避方法
以下のように--proxyで回避できます。
!pip install --proxy="http://proxy.com:8080" tensorflow
スクリプト内でのproxyの回避方法
以下のようにスクリプト内で、Proxy設定をすることで、回避できます。。
import os os.environ["http_proxy"] = "http://proxygate2.nic.nec.co.jp:8080" os.environ["https_proxy"] = "http://proxygate2.nic.nec.co.jp:8080"
スクリプト内でSSL のエラーが出る場合
SSLのCertificateの認証をOffにします。
import ssl ssl._create_default_https_context = ssl._create_unverified_context