作者热门文章
- mongodb - 在 MongoDB mapreduce 中,如何展平值对象?
- javascript - 对象传播与 Object.assign
- html - 输入类型 ="submit"Vs 按钮标签它们可以互换吗?
- sql - 使用 MongoDB 而不是 MS SQL Server 的优缺点
Docker 和 Tensorflow 的新手并尝试它们。安装(在win10上,使用hyper-v驱动)很顺利,我可以运行了
docker run -p 8888:8888 -it gcr.io/tensorflow/tensorflow
然后得到这样的输出:
[I 23:01:01.188 NotebookApp]←(B Serving notebooks from local directory: /notebooks
[I 23:01:01.189 NotebookApp]←(B 0 active kernels
[I 23:01:01.189 NotebookApp]←(B The Jupyter Notebook is running at: http://[all ip addresses on your system]:8888/
[I 23:01:01.189 NotebookApp]←(B Use Control-C to stop this server and shut down all kernels (twice to skip confirmation).
我可以通过打开 [docker host address]:8888 从浏览器打开 Jupyter notebook。
但是,在做了一些工作(例如,创建一个新笔记本)之后,当我按 Ctrl-C 两次停止服务器时,所有新工作都丢失了。也许我错过了一些基本的东西,所以让我把我不确定的东西放在这里:
感谢您的帮助。
最佳答案
您可以mount当前主机文件夹以替换容器中的默认 /notebooks
文件夹。这是一个例子:
$ docker run -p 8888:8888 -v `pwd`:/notebooks -it gcr.io/tensorflow/tensorflow
[I 02:34:49.393 NotebookApp] Writing notebook server cookie secret to /root/.local/share/jupyter/runtime/notebook_cookie_secret
[W 02:34:49.411 NotebookApp] WARNING: The notebook server is listening on all IP addresses and not using encryption. This is not recommended.
[I 02:34:49.420 NotebookApp] Serving notebooks from local directory: /notebooks
[I 02:34:49.421 NotebookApp] 0 active kernels
[I 02:34:49.421 NotebookApp] The Jupyter Notebook is running at: http://[all ip addresses on your system]:8888/?token=b9da5de7f61d6a968dc07e55c6157606a4f2f378cd764a91
[I 02:34:49.421 NotebookApp] Use Control-C to stop this server and shut down all kernels (twice to skip confirmation).
[C 02:34:49.422 NotebookApp]
Copy/paste this URL into your browser when you connect for the first time,
to login with a token:
http://localhost:8888/?token=b9da5de7f61d6a968dc07e55c6157606a4f2f378cd764a91
关于docker - Docker 上的 TensorFlow : How to save the work on Jupyter notebook?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/36756907/
我是一名优秀的程序员,十分优秀!