Spaces:
Runtime error
Runtime error
docker
Browse files12345678910111213141516171819202122232425262728293031323334353637# ---------- 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())print("Detectron2:", detectron2.__version__)PYENV GRADIO_SERVER_NAME=0.0.0.0 GRADIO_SERVER_PORT=7860EXPOSE 7860CMD ["python", "app.py"]123456789101112131415161718192021222324252627282930313233343536373839404142# ---------- 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, torchprint("Python:", sys.version)print("Torch:", torch.__version__, "CUDA:", torch.version.cuda, "cuda_available:", torch.cuda.is_available())import detectron2print("Detectron2:", detectron2.__version__)PYENV GRADIO_SERVER_NAME=0.0.0.0 GRADIO_SERVER_PORT=7860EXPOSE 7860CMD ["python3", "app.py"]
Dockerfile+21-16