forked from xyyang317/Aba-ViTrack
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile.gpu
More file actions
60 lines (48 loc) · 2.18 KB
/
Copy pathDockerfile.gpu
File metadata and controls
60 lines (48 loc) · 2.18 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
FROM nvidia/cuda:11.8.0-cudnn8-devel-ubuntu20.04
ENV DEBIAN_FRONTEND=noninteractive \
PYTHONUNBUFFERED=1
# Install system packages (development tools, OpenCV prerequisites, etc.)
RUN apt-get update && apt-get install -y --no-install-recommends \
git wget curl ca-certificates build-essential \
libglib2.0-0 libsm6 libxrender1 libxext6 libgl1-mesa-glx \
libjpeg-dev libpng-dev libtiff-dev liblmdb-dev \
python3.8 python3.8-dev python3.8-distutils python3-pip \
&& ln -s /usr/bin/python3.8 /usr/bin/python \
&& rm -rf /var/lib/apt/lists/*
# Copy ONLY requirements first (important!)
WORKDIR /app
COPY requirements.txt .
# Remove the torch lines from requirements.txt – they are already installed
RUN sed -i '/^torch/d' requirements.txt && \
sed -i '/^torchvision/d' requirements.txt && \
sed -i '/^torchaudio/d' requirements.txt
# Install PyTorch with typing_extensions fix (NO HOST CACHING)
RUN pip install --no-cache-dir typing_extensions==4.8.0 && \
pip install --no-cache-dir \
torch==2.4.1+cu118 \
torchvision==0.19.1+cu118 \
torchaudio==2.4.1+cu118 \
--index-url https://download.pytorch.org/whl/cu118
# Install remaining Python dependencies with an extended timeout
RUN python -m pip install --no-cache-dir --upgrade pip && \
pip install --default-timeout=1000 --no-cache-dir -r requirements.txt
# Now copy the rest of the project
COPY . .
# --- UNIVERSAL PATH FIX ---
# Wipe the tainted local.py and force the tracker to use the container's output folder
RUN echo "from lib.test.evaluation.environment import EnvSettings\n\
def local_env_settings():\n\
settings = EnvSettings()\n\
settings.results_path = '/app/outputs/tracking_results/'\n\
return settings\n" > lib/test/evaluation/local.py
# --------------------------
# Default environment variables (override with -e or by mounting new values)
ENV DATASET_ROOT=/dataset \
CONFIG_NAME=abavit_patch16_224 \
CHECKPOINT_PATH=/app/checkpoints/AbaViTrack_ep0010.pth.tar \
RESULTS_ROOT=/app/outputs/tracking_results \
OUTPUT_CSV=/app/submission.csv
RUN mkdir -p $RESULTS_ROOT
# GPU is available, set NUM_GPUS to 1 (can be overridden)
ENV NUM_GPUS=1
ENTRYPOINT ["python", "main.py"]