Spaces:
Runtime error
Runtime error
docker
Browse files123456789101112131415161718192021222324252627282930313233342 unmodified lines37383940# ---------- GPU build: CUDA 11.8 + Torch 2.1.2 + Detectron2 0.6 ----------FROM nvidia/cuda:11.8.0-cudnn8-runtime-ubuntu22.04ENV DEBIAN_FRONTEND=noninteractive \PIP_NO_CACHE_DIR=1 \PYTHONUNBUFFERED=1RUN 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/*WORKDIR /appRUN python3 -m pip install --upgrade pip# Torch/TV that match D2 0.6 wheels (cu118 / torch 2.1)RUN pip install --no-cache-dir --extra-index-url https://download.pytorch.org/whl/cu118 \torch==2.1.2+cu118 torchvision==0.16.2+cu118# Detectron2 0.6 prebuilt wheel for cu118 + torch2.1RUN pip install --no-cache-dir -f \https://dl.fbaipublicfiles.com/detectron2/wheels/cu118/torch2.1/index.html \detectron2==0.6# Your deps (ensure these do NOT list 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 + sanityCOPY . /appRUN python3 - <<'PY'import sys, torch, detectron2print("Python:", sys.version)print("Torch:", torch.__version__, "CUDA:", torch.version.cuda, "cuda_is_available:", torch.cuda.is_available())2 unmodified linesENV GRADIO_SERVER_NAME=0.0.0.0 GRADIO_SERVER_PORT=7860EXPOSE 7860CMD ["python3", "app.py"]123456789101112131415161718192021222324252627282930312 unmodified lines34353637# ---------- Detectron2 v0.6 wheel path (Torch 1.10 + cu113) ----------FROM pytorch/pytorch:1.10.2-cuda11.3-cudnn8-runtimeENV DEBIAN_FRONTEND=noninteractive PIP_NO_CACHE_DIR=1 PYTHONUNBUFFERED=1# Minimal system depsRUN apt-get update && apt-get install -y --no-install-recommends \python3-dev build-essential git libgl1 ffmpeg && \rm -rf /var/lib/apt/lists/*WORKDIR /appRUN python3 -m pip install --upgrade pip# Detectron2 v0.6 prebuilt (matches torch1.10/cu113; see official table)RUN pip install --no-cache-dir -f \https://dl.fbaipublicfiles.com/detectron2/wheels/cu113/torch1.10/index.html \detectron2==0.6# Your deps (ensure these 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# AppCOPY . /app# SanityRUN python - <<'PY'import sys, torch, detectron2print("Python:", sys.version)print("Torch:", torch.__version__, "CUDA:", torch.version.cuda, "cuda_is_available:", torch.cuda.is_available())2 unmodified linesENV GRADIO_SERVER_NAME=0.0.0.0 GRADIO_SERVER_PORT=7860EXPOSE 7860CMD ["python", "app.py"]
Dockerfile+16-19