首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >从码头容器内部使用AI模型的最佳实践

从码头容器内部使用AI模型的最佳实践
EN

Stack Overflow用户
提问于 2020-06-12 08:29:14
回答 1查看 95关注 0票数 1

我第一次使用TensorFlow docker镜像。在我开始投入大量时间之前,我想确保我知道文件应该放在哪里。我应该存储、运行、创建、保存容器中的所有文件,然后删除我以后想要删除的文件吗?是否应在主机上保留任何文件?

EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2020-06-12 11:24:19

总是在容器外部编辑文件。我建议你使用Docker Compose来设置你的Docker环境。下面是一个例子:

代码语言:javascript
复制
# Use version 2.3 of Docker Compose to access the GPU with NVIDIA-Docker 
# (it's the only version that supports GPUs
version: '2.3'

services:

  ai_container:
    image: ai_container
    container_name: ai_container
    working_dir: /ai_container/scripts
    build:
      context: .
      dockerfile: Dockerfile
    # You may want to expose the port 6006 to use Tensorboard
    ports:
      - "6006:6006"
    # Mount your scripts,logs,results and datasets (with read-only)
    volumes:
      - ./scripts:/ai_container/scripts
      - ./logs:/ai_container/logs
      - ./results:/ai_container/results
      - /hdd/my_heavy_dataset_folder/:/datasets:ro
    # Depending on the task you may need extra memory
    shm_size: '8gb'
    # This enables the GPU (requires NVIDIA-Docker)
    runtime: nvidia
    # Start Tensorboard to keep the container alive
    command: tensorboard --host 0.0.0.0 --logdir /ai_container/logs
票数 1
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/62335665

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档