docker及nvidia-docker的安装:
https://docs.nvidia.com/datacenter/cloud-native/container-toolkit/install-guide.html#installing-on-ubuntu-and-debian
值得注意,没有nvidia-docker的容器是无法利用宿主机硬件显卡的
docker的镜像打包与加载
基础操作:https://blog.csdn.net/u013730110/article/details/107620876
基础镜像:
docker pull meadml/cuda10.1-cudnn7-devel-ubuntu18.04-python3.6
先进入基础镜像的容器配置环境:docker run --name cam_env -it meadml/cuda10.1-cudnn7-devel-ubuntu18.04-python3.6 bash
然后导出修改过后的容器:docker export -o cam_env.tar cam_env 加载镜像:docker import cam_env.tar cam_env:v1
运行镜像的容器
sudo docker run -e PYTHONIOENCODING=utf-8 -it -v /home/zzt/cam/code:/home/code -v /media/zzt/M/pretend/VOC2007:/home/code/YOLOX/datasets/VOCdevkit/VOC2007 --rm --gpus all cam_env:v1 bash
–rm --gpus all 让容器可以调用显卡 -e PYTHONIOENCODING=utf-8 解决docker python提示错误UnicodeEncodeError: ‘ascii’ codec can’t encode characters in position 参考
|