[英]How to save and edit a Jupyter notebook in a host directory using official Tensorflow docker container?
I want to use the official Tensorflow docker images to create and edit a Jupyter notebook stored on the host. 我想使用官方的Tensorflow docker镜像来创建和编辑存储在主机上的Jupyter笔记本。
I'm a little confused with what switches I need to provide. 我对我需要提供的开关感到困惑。 To run a Tensorflow script on the host the docs suggest: 要在主机上运行Tensorflow脚本,文档建议:
docker run -it --rm -v $PWD:/tmp -w /tmp tensorflow/tensorflow python ./script.py
..and to run the Jupyter service: ..并运行Jupyter服务:
docker run -it -p 8888:8888 tensorflow/tensorflow:nightly-py3-jupyter
When I try merging the switches to run Jupyter + mount the host volume: 当我尝试合并交换机以运行Jupyter + mount主机卷时:
docker run -it --rm -v $PWD:/tmp -w /tmp -p 8888:8888 tensorflow/tensorflow:nightly-py3-jupyter
...its still accessing notebooks stored in the container, not the host. ...它仍在访问存储在容器中的笔记本,而不是主机。
Notebooks are stored inside the container /tf folder, so copying your files there will do the trick: 笔记本存储在container / tf文件夹中,因此将文件复制到那里就可以了:
docker run -it --rm -v $PWD:/tf -p 8888:8888 tensorflow/tensorflow:nightly-py3-jupyter
The first command you mentioned is used to run a TensorFlow program developed on the host machine, not a notebook. 您提到的第一个命令用于运行在主机上开发的TensorFlow程序 ,而不是笔记本。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.