Warning: file_get_contents(/data/phpspider/zhask/data//catemap/0/docker/9.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Docker中运行的Jupyter笔记本的本地文件?_Docker_Jupyter Notebook_Volume_Docker Container - Fatal编程技术网

Docker中运行的Jupyter笔记本的本地文件?

Docker中运行的Jupyter笔记本的本地文件?,docker,jupyter-notebook,volume,docker-container,Docker,Jupyter Notebook,Volume,Docker Container,背景 我遵循了教程 这一进程如下: 从Dockerfile为TensorFlow对象检测API创建图像和容器 在Dockerfile的末尾,启动了一个Jupyter笔记本,我可以查看和编辑通过github克隆的所有内容 我不得不做一些修改使它工作,但它现在正在工作 然后我将这张图片推送到Dockerhub,并命名为:tf_od_api:part1 用于启动名为tensorflow的容器的命令: docker run--runtime=nvidia-it--name tensorflow-p 88

背景

我遵循了教程 这一进程如下:

  • 从Dockerfile为TensorFlow对象检测API创建图像和容器

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

  • 我不得不做一些修改使它工作,但它现在正在工作

  • 然后我将这张图片推送到Dockerhub,并命名为:tf_od_api:part1

  • 用于启动名为tensorflow的容器的命令:

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

  • 容器ID是dc91f5b5e6759bac3dfe4e713406fd0e2a217637241a45d9a20d5cfc347d40d8

  • Jupyter笔记本位于地址
    localhost:8888


  • Jupyter笔记本的GUI中没有数据

    现在,我想使用本地数据(超过10GB)进行对象检测,为此,我需要使用来自对象检测api的脚本,该脚本将创建和保存TFR记录,以备将来执行任务。所以我需要保存这些数据,但我不想每次都上传。 我尝试了给出的解决方案。我对其使用的命令是:

    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笔记本电脑如何使用我的本地文件?我想你很快就会明白了——notebook dir是你在Jupyter中看到的目录,即/tensorflow/models/research/object\u detection,因此你需要将数据装载到容器上该目录的子目录中。试试:-v/home/aev21/data/KITTI:/tensorflow/models/research/object\u detection/data\u host/KITTI成功了!非常感谢!这是否意味着我从主机以及docker容器写入该文件夹的所有内容都将保留?是的,当您写入容器上的该目录时,因为它是从主机装载的,所以您可以修改主机上的该目录。如果您解决了该问题,您能否回答您的问题?这有点难理解。