Spaces:
Runtime error
Runtime error
docker
Browse files112345667898101110121314121516171819202122232416172526272820212930313233253435272836373830394041423 unmodified lines46474849505152# ---------- GPU build: CUDA 11.3 + Torch 1.10.2 + D2 0.6 ----------# ---------- GPU build: CUDA 11.3 + Torch 1.10.2 + Detectron2 0.6 ----------FROM nvidia/cuda:11.3.1-cudnn8-runtime-ubuntu20.04
ENV DEBIAN_FRONTEND=noninteractive \ PIP_NO_CACHE_DIR=1 \ PYTHONUNBUFFERED=1 PYTHONUNBUFFERED=1 \ OMP_NUM_THREADS=1 \ MPLCONFIGDIR=/tmp/matplotlib
# Python 3.8 on 20.04 + build deps# System deps (Python 3.8 on Ubuntu 20.04)RUN apt-get update && apt-get install -y --no-install-recommends \ python3 python3-pip python3-dev build-essential git libgl1 ffmpeg \ python3 python3-pip python3-dev build-essential git \ libgl1 ffmpeg \ && rm -rf /var/lib/apt/lists/*RUN python3 -m pip install --upgrade pip
# Matplotlib writable cache dirRUN mkdir -p /tmp/matplotlib
WORKDIR /appRUN python3 -m pip install --upgrade pip
# ----- Pin Pillow < 10 first (Detectron2 0.6 expects Image.LINEAR/BILINEAR names) -----RUN python3 -m pip install --no-cache-dir "Pillow<10"
# ----- PyTorch 1.10.2 + cu113 (matches D2 0.6 wheel matrix) -----RUN pip install --no-cache-dir -f https://download.pytorch.org/whl/cu113/torch_stable.html \# ----- PyTorch 1.10.2 + cu113 (matches D2 0.6 prebuilt wheels) -----RUN python3 -m pip install --no-cache-dir -f https://download.pytorch.org/whl/cu113/torch_stable.html \ torch==1.10.2+cu113 torchvision==0.11.3+cu113
# ----- Detectron2 0.6 prebuilt for torch1.10 + cu113 -----RUN pip install --no-cache-dir -f \# ----- Detectron2 0.6 prebuilt wheel for torch1.10 + cu113 -----RUN python3 -m pip install --no-cache-dir -f \ https://dl.fbaipublicfiles.com/detectron2/wheels/cu113/torch1.10/index.html \ detectron2==0.6
# ----- Your deps (ensure they DO NOT pin torch/torchvision/detectron2) -----# ----- Your deps (ensure they don't re-pin torch/torchvision/detectron2/Pillow) -----COPY requirements.txt /app/requirements.txtRUN sed -i '/^torch/d;/^torchvision/d;/^detectron2/d' /app/requirements.txt && \ pip install --no-cache-dir -r /app/requirements.txtRUN sed -i '/^[Pp]illow/d;/^torch/d;/^torchvision/d;/^detectron2/d' /app/requirements.txt && \ python3 -m pip install --no-cache-dir -r /app/requirements.txt
# ----- App code + quick sanity print -----# ----- App code + sanity print -----COPY . /appRUN python3 - <<'PY'import sys, torch3 unmodified linesprint("Detectron2:", detectron2.__version__)PY
# Gradio server envENV GRADIO_SERVER_NAME=0.0.0.0 GRADIO_SERVER_PORT=7860EXPOSE 7860CMD ["python3", "app.py"]Dockerfile+23-13