41 Star 562 Fork 221

GVPRock_Kim/Myolotrain

加入 Gitee
与超过 1400万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
Dockerfile.gpu 1.34 KB
一键复制 编辑 原始数据 按行查看 历史
Rock_Kim 提交于 2025-10-13 15:45 +08:00 . 更新依赖以及docker安装优化
FROM nvidia/cuda:12.0.1-cudnn8-runtime-ubuntu22.04
# 使用国内镜像源加速 apt
RUN sed -i 's/archive.ubuntu.com/mirrors.ustc.edu.cn/g' /etc/apt/sources.list && \
sed -i 's/security.ubuntu.com/mirrors.ustc.edu.cn/g' /etc/apt/sources.list
# 避免交互提示
ENV DEBIAN_FRONTEND=noninteractive
# 安装 Python 和系统依赖
RUN apt-get update && apt-get install -y \
python3.12 \
python3.12-dev \
python3-pip \
build-essential \
libpq-dev \
ffmpeg \
libsm6 \
libxext6 \
&& rm -rf /var/lib/apt/lists/*
# 设置 pip 使用国内镜像源(全局生效)
ENV PIP_INDEX_URL=https://pypi.tuna.tsinghua.edu.cn/simple
ENV PIP_TRUSTED_HOST=pypi.tuna.tsinghua.edu.cn
# 设置工作目录
WORKDIR /app
# 复制依赖文件并安装
COPY requirements.txt .
# 安装基础依赖,并添加GPU版本的onnxruntime 1.21.0
RUN python3.12 -m pip install --no-cache-dir -r requirements.txt onnxruntime-gpu==1.21.0
# 安装 PyTorch GPU 版本 (兼容CUDA 12.0)
RUN python3.12 -m pip install torch torchvision torchaudio --index-url https://download.pytorch.org/whl/cu121
# 复制应用代码
COPY . .
# 创建必要的目录
RUN mkdir -p app/static/uploads app/static/datasets app/static/models app/static/results app/static/annotations logs/tensorboard
# 暴露端口
EXPOSE 8000 6006
# 启动命令
CMD ["python3.12", "run.py"]
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
Python
1
https://gitee.com/rock_kim/Myolotrain.git
git@gitee.com:rock_kim/Myolotrain.git
rock_kim
Myolotrain
Myolotrain
master

搜索帮助