一、概述
由于GPU的资源比较昂贵,尤其在云端,为了充分利用GPU资源,考虑用GPU资源虚拟化。为了让YOLOv3 GPU版本能够在虚拟化环境运行,需要安装YOLOv3 GPU版本耐以运行的Docker环境。
二、安装YOLOv3 GPU环境到Docker
2.1、编写Dockerfile
#我这里从dockerhub选用cuda10.0,cudnn7.0,ubuntu16.04的镜像为基础镜像
FROM my-registry:5000/nvidia/cuda:10.0-cudnn7-runtime-ubuntu16.04
#加上国内源,提升下载速度,这里我不给出,你可以追加国内源,到docker ubuntu系统的/etc/apt/sources.list文件内。
#RUN cp /etc/apt/sources.list /etc/apt/sources.list.old
#ADD sources.list /etc/apt/sources.list
#必须先更新,方可进行后面的安装动作
RUN apt-get update
#安装必要的编译所需工具和其他基础软件
RUN apt-get install -y software-properties-common
RUN apt-get install -y build-essential
RUN apt-get install -y python3-pip
RUN pip3 install --upgrade pip
# 安装numpy opencv
RUN python3 -m pip install wheel
RUN apt-get install -y python3-scipy
RUN apt-get install -y python3-nose
RUN python3 -m pip install numpy -i https://pypi.tuna.tsinghua.edu.cn/