Spaces:
Runtime error
Runtime error
docker
Browse files1234567891011121314151617181920212223242526272829303132333 unmodified lines373839404142# ---------- GPU build: CUDA 11.3 + Torch 1.10.2 + D2 0.6 ----------FROM nvidia/cuda:11.3.1-cudnn8-runtime-ubuntu20.04ENV DEBIAN_FRONTEND=noninteractive \PIP_NO_CACHE_DIR=1 \PYTHONUNBUFFERED=1# Python 3.8 on 20.04 + build depsRUN apt-get update && apt-get install -y --no-install-recommends \python3 python3-pip python3-dev build-essential git libgl1 ffmpeg \&& rm -rf /var/lib/apt/lists/*RUN python3 -m pip install --upgrade pipWORKDIR /app# ----- 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 \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 \https://dl.fbaipublicfiles.com/detectron2/wheels/cu113/torch1.10/index.html \detectron2==0.6# ----- Your deps (ensure they DO NOT pin torch/torchvision/detectron2) -----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.txt# ----- App code + quick sanity print -----COPY . /appRUN python3 - <<'PY'import sys, torch3 unmodified linesprint("Detectron2:", detectron2.__version__)PYENV GRADIO_SERVER_NAME=0.0.0.0 GRADIO_SERVER_PORT=7860EXPOSE 7860CMD ["python3", "app.py"]1234567891011121314151617181920212223242526272829303132333435363738394041423 unmodified lines46474849505152# ---------- GPU build: CUDA 11.3 + Torch 1.10.2 + Detectron2 0.6 ----------FROM nvidia/cuda:11.3.1-cudnn8-runtime-ubuntu20.04ENV DEBIAN_FRONTEND=noninteractive \PIP_NO_CACHE_DIR=1 \PYTHONUNBUFFERED=1 \OMP_NUM_THREADS=1 \MPLCONFIGDIR=/tmp/matplotlib# 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 \&& rm -rf /var/lib/apt/lists/*# Matplotlib writable cache dirRUN mkdir -p /tmp/matplotlibWORKDIR /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 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 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 don't re-pin torch/torchvision/detectron2/Pillow) -----COPY requirements.txt /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 + 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