带有Tensorflow的Docker

时间:2019-04-09 06:20:17

标签: python docker tensorflow

我尝试使用docker。我从这里开始:

~/tensorflow$ docker run -u $(id -u):$(id -g) -it -p 8888:8888 tensorflow/tensorflow:nightly-py3-jupyter

打印出来:

________                               _______________                
___  __/__________________________________  ____/__  /________      __
__  /  _  _ \_  __ \_  ___/  __ \_  ___/_  /_   __  /_  __ \_ | /| / /
_  /   /  __/  / / /(__  )/ /_/ /  /   _  __/   _  / / /_/ /_ |/ |/ / 
/_/    \___//_/ /_//____/ \____//_/    /_/      /_/  \____/____/|__/


You are running this container as user with ID 1000 and group 1000,
which should map to the ID and group for your user on the Docker host. Great!

[I 05:42:44.497 NotebookApp] Writing notebook server cookie secret to /.local/share/jupyter/runtime/notebook_cookie_secret
/usr/local/lib/python3.5/dist-packages/IPython/paths.py:68: UserWarning: IPython parent '/' is not a writable location, using a temp directory.
  " using a temp directory.".format(parent))
[I 05:42:45.970 NotebookApp] Serving notebooks from local directory: /tf

哪个IPython父级“ /”不可写? 我的系统上也没有目录/ tf。

[I 05:42:45.971 NotebookApp] The Jupyter Notebook is running at:
[I 05:42:45.971 NotebookApp] http://(87eb400fcb15 or 127.0.0.1):8888/?token=52ea6e8417f21a2cf0463ce147747f79ff6a7e290014a768
[I 05:42:45.971 NotebookApp] Use Control-C to stop this server and shut down all kernels (twice to skip confirmation).
[C 05:42:45.975 NotebookApp] 

    To access the notebook, open this file in a browser:
        file:///.local/share/jupyter/runtime/nbserver-12-open.html
    Or copy and paste one of these URLs:
        http://(87eb400fcb15 or 127.0.0.1):8888/?token=52ea6e8417f21a2cf0463ce147747f79ff6a7e290014a768
[I 05:44:25.595 NotebookApp] 302 GET /?token=52ea6e8417f21a2cf0463ce147747f79ff6a7e290014a768 (172.17.0.1) 1.23ms
[I 05:44:44.277 NotebookApp] Writing notebook-signing key to /.local/share/jupyter/notebook_secret

它说它想写“ notebook_cookie_secret”,但是,在jupyter中没有目录运行时。 jupyter的权限:

~/.local/share$ ls -la jupyter/
total 16
drwxr-xr-x  4 ronald ronald 4096 Jan 29 09:10 .
drwx------ 30 ronald ronald 4096 Apr  8 09:39 ..
drwxr-xr-x  3 ronald ronald 4096 Jan 29 09:10 kernels
drwxr-xr-x  3 ronald ronald 4096 Jan 29 09:10 nbextensions

由于文件不存在,因此无法访问文件:///。

我可以通过127.0.0.1/ ...访问笔记本电脑

我在浏览器的另一个选项卡中打开了这三个文件。这将启动两个文件basic_classification.ipynb和basic_text_classification.ipynb

我在那里。我不知道会发生什么,或者如何使事情发生。我以为,也许需要时间,但即使一小时后,它仍显示“正在运行”。请给我一些提示。

1 个答案:

答案 0 :(得分:-1)

我不认为您可以通过这种方式直接在Docker上运行Jupyter文件,因为Docker Image设置为不直接更改。

尝试使用该库作为解决方案:

https://github.com/yhilpisch/ipynb-docker