Setup tensorflow in Docker

you can find the info here:PUBLIC REPOSITORY tensorflow/tensorflow

pull it:

docker pull tensorflow/tensorflow:latest

Start CPU only container

$ docker run -it -p 8888:8888 tensorflow/tensorflow

Go to your browser on http://localhost:8888/

  • question1
    When I enter this web page, it command me to input the password but I do not set it before. So I need to Setup a Password:
    在这里插入图片描述
    But where is the token value? you can find it in the shell log, just like:
    在这里插入图片描述
  • question2
    in the jupyter I find that it only supports the python2 but I want the python3 kernel, so how to install it?
    start a new terminal, with the command python3 --version I can find the python3 has been installed, but the pip3 is not by the command python3 -m pip --version.
    Firstly install pip3,search the linux version with comand cat /proc/version,find it is linuxkit,then:
apt-get udpate
apt-get install python3-pip
python3 -m pip install ipykernel
python3 -m ipykernel install --user

but there is something wrong with my network and I can not find a way to make the python2 and python3 exist together, so I have to setup tensorflow again with the python3:

docker pull tensorflow/tensorflow:latest-py3
docker run -it -p 8888:8888 tensorflow/tensorflow:latest-py3

在这里插入图片描述

Start GPU (CUDA) container

Install nvidia-docker and run:

$ docker run --runtime=nvidia -it -p 8888:8888 tensorflow/tensorflow:latest-gpu

then Go to your browser on http://localhost:8888/

Other versions (like release candidates, nightlies and more)

See the list of tags. Devel docker images include all the necessary dependencies to build from source whereas the other binaries simply have TensorFlow installed.

For more details details see

https://github.com/tensorflow/tensorflow/blob/master/tensorflow/tools/docker/README.md

Reference

Support python3 on Docker image tensorflow
如何在 Docker 里切换 Python 版本

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值