Rushikesh-Sontakke commited on
Commit
5d5dd00
·
1 Parent(s): ccc91e5

Install torchvision from CPU index to match torch

Browse files
Files changed (1) hide show
  1. Dockerfile +5 -2
Dockerfile CHANGED
@@ -21,9 +21,12 @@ ENV HOME=/home/user \
21
 
22
  WORKDIR /home/user/app
23
 
24
- # Install CPU-only PyTorch first (smaller, no CUDA), then the rest
 
 
25
  RUN pip install --no-cache-dir --upgrade pip && \
26
- pip install --no-cache-dir torch==2.7.1 --index-url https://download.pytorch.org/whl/cpu
 
27
 
28
  # Dependency layer (cached unless requirements.txt changes)
29
  COPY --chown=user requirements.txt .
 
21
 
22
  WORKDIR /home/user/app
23
 
24
+ # Install CPU-only PyTorch + torchvision FIRST, both from the CPU index so their
25
+ # compiled ops match. (If torchvision comes from default PyPI it's the CUDA build
26
+ # and fails at runtime with "operator torchvision::nms does not exist".)
27
  RUN pip install --no-cache-dir --upgrade pip && \
28
+ pip install --no-cache-dir torch==2.7.1 torchvision==0.22.1 \
29
+ --index-url https://download.pytorch.org/whl/cpu
30
 
31
  # Dependency layer (cached unless requirements.txt changes)
32
  COPY --chown=user requirements.txt .