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 <noreply@anthropic.com>
This commit is contained in:
2026-04-19 16:08:35 +02:00
parent 5d45b8d8eb
commit a3c657c66e
2 changed files with 4 additions and 4 deletions
+2 -2
View File
@@ -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
}
}
+2 -2
View File
@@ -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"