image1 image2 image3

HELLO I'M Pinman|WELCOME TO MY PERSONAL BLOG|I LOVE TO DO CREATIVE THINGS|I'M WEB DEVELOPER

nvidia-docker 中使用 tensorflow-gpu/jupyter

Create Docker Container

抓取 Tensorflow 最新GPU版本:
$ docker pull tensorflow/tensorflow:latest-gpu-py3
查看所有 images:
$ docker images
確認是否有剛剛抓取的 tensorflow/tensorflow

執行 Image 產生 Container:
$ nvidia-docker run --name testensor -e NVIDIA_VISIBLE_DEVICES=0,1,2,3 --ipc=host -v ~/joyce/:/workspace -p 7777:8888 -it tensorflow/tensorflow:latest-gpu-py3

# arguments
# --neme [your custom container name]
# -e any environment variable
# -ipc IPC mode for the container [| none | private | shareable | host | container: <_name-or-ID_>]
# -v shared filesystems [host-src:container-dest]
# -p publish a container's port or a range of ports to the host [ip:hostPort:containerPort | ip::containerPort | hostPort:containerPort | containerPort]
# -it [image id or name]

Docker Usage

啟動 Container:
$ docker start [container_name]
刪除 Container:
$ docker rm [container_name]
進入 Container:
$ docker attach [container_name]
查看所有 Container:
$ docker ps -a
查看目前運行中的 Container:
$ docker ps

Jupyter Notebook

安裝 Jupyter Notebook:
$ pip3 install ipython notebook
$ ipython3 kernelspec install-self
啟動 Jupyter Notebook:
$ jupyter notebook --ip 0.0.0.0 --no-browser --allow-root

開啟網頁輸入網址 http://[your_ip_address]:7777

背景執行 jupyter notebook

暫停當前在 terminal 執行的指令:
$ CTRL + Z
開始在背景中執行上一個被暫停的指令:
$ bg

Share this:

CONVERSATION

0 意見:

張貼留言