Skip to content

Commit c188b12

Browse files
authored
Merge pull request #89 from FranckyB/dev
feat: Update PyTorch installation to match CUDA version with specific torch/torchaudio/torchvision versions
2 parents e09a051 + 1de1f21 commit c188b12

1 file changed

Lines changed: 21 additions & 5 deletions

File tree

setup-windows.bat

Lines changed: 21 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -199,14 +199,30 @@ REM Install PyTorch
199199
echo [5/7] Installing PyTorch...
200200
setlocal enabledelayedexpansion
201201

202-
if "%CUDA_CHOICE%"=="1" set CUDA_VER=cu130
203-
if "%CUDA_CHOICE%"=="2" set CUDA_VER=cu128
204-
if "%CUDA_CHOICE%"=="3" set CUDA_VER=cu121
202+
REM Version matrix: each CUDA version requires matching torch/torchaudio/torchvision
203+
if "%CUDA_CHOICE%"=="1" (
204+
set CUDA_VER=cu130
205+
set TORCH_VER=2.9.1
206+
set TORCHAUDIO_VER=2.9.1
207+
set TORCHVISION_VER=0.24.1
208+
)
209+
if "%CUDA_CHOICE%"=="2" (
210+
set CUDA_VER=cu128
211+
set TORCH_VER=2.9.1
212+
set TORCHAUDIO_VER=2.9.1
213+
set TORCHVISION_VER=0.24.1
214+
)
215+
if "%CUDA_CHOICE%"=="3" (
216+
set CUDA_VER=cu121
217+
set TORCH_VER=2.5.1
218+
set TORCHAUDIO_VER=2.5.1
219+
set TORCHVISION_VER=0.20.1
220+
)
205221

206222
if defined CUDA_VER (
207-
echo Installing PyTorch with !CUDA_VER!...
223+
echo Installing PyTorch !TORCH_VER! with !CUDA_VER!...
208224
echo This may take several minutes...
209-
pip install torch==2.9.1 torchaudio==2.9.1 torchvision==0.24.1 --index-url https://download.pytorch.org/whl/!CUDA_VER!
225+
pip install torch==!TORCH_VER! torchaudio==!TORCHAUDIO_VER! torchvision==!TORCHVISION_VER! --index-url https://download.pytorch.org/whl/!CUDA_VER!
210226
if !errorlevel! neq 0 (
211227
echo ERROR: Failed to install PyTorch!
212228
pause

0 commit comments

Comments
 (0)