tensorflow

nvidia-docker tensorflow - gpu

2018-07-11  本文已影响164人  Persistently

1.安装nvidia-docker

   $ wget -P /tmp https://github.com/NVIDIA/nvidia-docker/releases/download/v1.0.1/nvidia-docker_1.0.1-1_amd64.deb
   $ sudo dpkg -i /tmp/nvidia-docker*.deb

无网络安装可能就麻烦一点
下载现成的rmp包
nvidia-docker-1.0.1-1.x86_64.rpm

   $ sudo rpm -i ./nvidia-docker-*.rpm

2. pull tensorflow镜像

   $ nvidia-docker pull tensorflow/tensorflow:latest-gpu

3. 运行

 sudo service nvidia-docker start  #一定要开启
 sudo nvidia-docker run -it -p 8888:8888 tensorflow/tensorflow:latest-gpu 或者
 sudo nvidia-docker run -it -p 8888:8888 tensorflow/tensorflow:latest-gpu /bin/bash 
 $ sudo nvidia-docker exec -it pp_tf  /bin/bash #

$ systemctl start nvidia-docker  #开启nvidia-docker
$ systemctl status nvidia-docker #查看nvidia-docker状态

$ sudo nvidia-docker run --rm nvidia/cuda nvidia-smi
在这个基础上安装其他包,再进行commit

**4. docker save **

sudo docker save 840bf96be71f  -o /dir/pp_tf_gpu_v1.tar #将镜像保存  也可以用镜像名进行保存

5. docker load
docker load < / dir/pp_tf_gpu_v1.tar #可以重新加载镜像了
sudo docker tag 840bf96be71f pp/tf:v1 #设置tag

上一篇下一篇

猜你喜欢

热点阅读