From a3c657c66ef0c092c37e2a976d333da16926ad02 Mon Sep 17 00:00:00 2001 From: Ethanfel Date: Sun, 19 Apr 2026 16:08:35 +0200 Subject: [PATCH] fix: install torchvision from CUDA index to prevent ABI mismatch timm and ultralytics depend on torchvision. When pip install -r requirements.txt resolves them, it pulls torchvision from PyPI (CPU build) which is incompatible with CUDA torch, causing "operator torchvision::nms does not exist" at import time. Co-Authored-By: Claude Opus 4.6 --- setup-windows.ps1 | 4 ++-- setup_env.sh | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/setup-windows.ps1 b/setup-windows.ps1 index a3cab54..71e7b36 100644 --- a/setup-windows.ps1 +++ b/setup-windows.ps1 @@ -30,11 +30,11 @@ if ($LASTEXITCODE -eq 0) { $hasNvidia = Get-Command nvidia-smi -ErrorAction SilentlyContinue if ($hasNvidia) { Write-Host "`nNVIDIA GPU detected — installing PyTorch with CUDA 12.8..." -ForegroundColor Green - pip install torch torchaudio --index-url https://download.pytorch.org/whl/cu128 + pip install torch torchaudio torchvision --index-url https://download.pytorch.org/whl/cu128 } else { Write-Host "`nNo NVIDIA GPU detected — installing CPU-only PyTorch..." -ForegroundColor Yellow Write-Host "(Audio scanning will work but will be slower without GPU)" -ForegroundColor Yellow - pip install torch torchaudio --index-url https://download.pytorch.org/whl/cpu + pip install torch torchaudio torchvision --index-url https://download.pytorch.org/whl/cpu } } diff --git a/setup_env.sh b/setup_env.sh index f256663..89dfff5 100755 --- a/setup_env.sh +++ b/setup_env.sh @@ -66,7 +66,7 @@ setup_conda() { fi echo " Installing PyTorch + torchaudio (CUDA 12.8)..." - pip install torch torchaudio --index-url "$TORCH_INDEX" + pip install torch torchaudio torchvision --index-url "$TORCH_INDEX" echo " Installing project dependencies..." pip install -r "$SCRIPT_DIR/requirements.txt" @@ -91,7 +91,7 @@ setup_venv() { source "$VENV_DIR/bin/activate" echo " Installing PyTorch + torchaudio (CUDA 12.8)..." - pip install torch torchaudio --index-url "$TORCH_INDEX" + pip install torch torchaudio torchvision --index-url "$TORCH_INDEX" echo " Installing project dependencies..." pip install -r "$SCRIPT_DIR/requirements.txt"