在Docker中运行的Jupyter Notebook的本地文件?

时间:2018-11-02 11:18:41

标签: docker jupyter-notebook volume docker-container

背景

  

我遵循了教程   here   通过以下方式进行:

     
      
  1. 创建一个图像,然后从Dockerfile中创建TensorFlow对象检测API的容器。

  2.   
  3. 在Dockerfile的末尾,启动了Jupyter笔记本,我可以查看和编辑通过github克隆的所有内容。

  4.   
  5. 我必须进行一些修改才能使其正常运行,但现在可以正常工作。

  6.   
  7. 然后我将此图像以名称tf_od_api:part1推送到Dockerhub。

  8.   
  9. 用于启动名为tensorflow的容器的命令:

         
        

    docker run --runtime = nvidia -it --name tensorflow -p 8888:8888 -d kneazle / tf_od_api:part1

      
  10.   
  11. 容器ID为dc91f5b5e6759bac3dfe4e713406fd0e2a217637241a45d9a20d5cfc347d40d8

  12.   地址为localhost:8888
  13. Jupyter笔记本。

  14.   

Jupyter笔记本电脑的GUI中没有数据

现在,我想使用我的本地数据(超过10 GB)进行对象检测,为此,我需要使用对象检测api中的脚本,该脚本将创建并保存tfrecords用于以后的任务。因此,我需要保存这些数据,但是我不想每次都上传。 我尝试了给定here的解决方案。我使用的命令是:

docker run -v /home/kneazle/data/KITTI:/data_host/KITTI kneazle/tf_od_api:part1

但是此命令输出为:

[I 11:06:50.547 NotebookApp] Writing notebook server cookie secret to /root/.local/share/jupyter/runtime/notebook_cookie_secret
[W 11:06:50.560 NotebookApp] All authentication is disabled.  Anyone who can connect to this server will be able to run code.
[I 11:06:50.564 NotebookApp] Serving notebooks from local directory: /tensorflow/models/research/object_detection
[I 11:06:50.564 NotebookApp] The Jupyter Notebook is running at:
[I 11:06:50.564 NotebookApp] http://(a915e0cd0fd0 or 127.0.0.1):8888/
[I 11:06:50.564 NotebookApp] Use Control-C to stop this server and shut down all kernels (twice to skip confirmation).

我在之前或之后启动的Jupyter笔记本中看不到数据。我也尝试过

docker run --runtime=nvidia -it 
    --name tensorflow -p 8888:8888 
    -v /home/kneazle/data/KITTI:/data_host/KITTI kneazle/tf_od_api:part1

如何将我的本地文件用于在Docker中运行的Jupyter笔记本?

0 个答案:

没有答案