我第一次使用TensorFlow docker镜像。在我开始投入大量时间之前,我想确保我知道文件应该放在哪里。我应该存储、运行、创建、保存容器中的所有文件,然后删除我以后想要删除的文件吗?是否应在主机上保留任何文件?
发布于 2020-06-12 11:24:19
总是在容器外部编辑文件。我建议你使用Docker Compose来设置你的Docker环境。下面是一个例子:
# 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/logshttps://stackoverflow.com/questions/62335665
复制相似问题