Skip to content

Commit 49557ff

Browse files
committed
fix numpy, optimum
1 parent 1ad6edf commit 49557ff

3 files changed

Lines changed: 13 additions & 17 deletions

File tree

modules/launch_utils.py

Lines changed: 10 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ def check_python_version():
3939
micro = sys.version_info.micro
4040

4141
if is_windows:
42-
supported_minors = [10]
42+
supported_minors = [10, 11]
4343
else:
4444
supported_minors = [7, 8, 9, 10, 11]
4545

@@ -50,16 +50,12 @@ def check_python_version():
5050
f"""
5151
INCOMPATIBLE PYTHON VERSION
5252
53-
This program is tested with 3.10.6 Python, but you have {major}.{minor}.{micro}.
53+
This program is tested with 3.11 Python, but you have {major}.{minor}.{micro}.
5454
If you encounter an error with "RuntimeError: Couldn't install torch." message,
5555
or any other error regarding unsuccessful package (library) installation,
56-
please downgrade (or upgrade) to the latest version of 3.10 Python
56+
please downgrade (or upgrade) to the latest version of 3.11 Python
5757
and delete current Python and "venv" folder in WebUI's directory.
5858
59-
You can download 3.10 Python from here: https://www.python.org/downloads/release/python-3106/
60-
61-
{"Alternatively, use a binary release of WebUI: https://github.com/AUTOMATIC1111/stable-diffusion-webui/releases/tag/v1.0.0-pre" if is_windows else ""}
62-
6359
Use --skip-python-version-check to suppress this warning.
6460
"""
6561
)
@@ -434,19 +430,19 @@ def prepare_environment():
434430
system = platform.system()
435431
nvidia_driver_found = False
436432
backend = "cuda"
437-
torch_command = "pip install torch==2.7.0 torchvision --extra-index-url https://download.pytorch.org/whl/cu121"
433+
torch_command = "pip install torch==2.7.0 torchvision numpy==1.26.4 --extra-index-url https://download.pytorch.org/whl/cu121"
438434

439435
if args.use_cpu_torch:
440436
backend = "cpu"
441437
torch_command = os.environ.get(
442438
"TORCH_COMMAND",
443-
"pip install torch==2.7.0 torchvision",
439+
"pip install torch==2.7.0 torchvision numpy==1.26.4",
444440
)
445441
elif args.use_directml:
446442
backend = "directml"
447443
torch_command = os.environ.get(
448444
"TORCH_COMMAND",
449-
"pip install torch torchvision torch-directml",
445+
"pip install torch==2.4.1 torchvision torch-directml numpy==1.26.4",
450446
)
451447
args.skip_python_version_check = True
452448
elif args.use_zluda:
@@ -484,7 +480,7 @@ def prepare_environment():
484480
)
485481
torch_command = os.environ.get(
486482
"TORCH_COMMAND",
487-
f"pip install torch==2.7.0 torchvision --index-url {torch_index_url}",
483+
f"pip install torch==2.7.0 torchvision numpy==1.26.4 --extra-index-url {torch_index_url}",
488484
)
489485
else:
490486
nvidia_driver_found = shutil.which("nvidia-smi") is not None
@@ -496,7 +492,7 @@ def prepare_environment():
496492
)
497493
torch_command = os.environ.get(
498494
"TORCH_COMMAND",
499-
f"pip install torch==2.7.0 torchvision --extra-index-url {torch_index_url}",
495+
f"pip install torch==2.7.0 torchvision numpy==1.26.4 --extra-index-url {torch_index_url}",
500496
)
501497

502498
requirements_file = os.environ.get('REQS_FILE', "requirements_versions.txt")
@@ -593,13 +589,13 @@ def prepare_environment():
593589
if error is None:
594590
try:
595591
zluda_installer.load()
596-
torch_command = os.environ.get('TORCH_COMMAND', 'pip install torch==2.7.0 torchvision --index-url https://download.pytorch.org/whl/cu118')
592+
torch_command = os.environ.get('TORCH_COMMAND', 'pip install torch==2.7.0 torchvision numpy==1.26.4 --extra-index-url https://download.pytorch.org/whl/cu118')
597593
except Exception as e:
598594
error = e
599595
print(f'Failed to load ZLUDA: {e}')
600596
if error is not None:
601597
print('Using CPU-only torch')
602-
torch_command = os.environ.get('TORCH_COMMAND', 'pip install torch torchvision')
598+
torch_command = os.environ.get('TORCH_COMMAND', 'pip install torch==2.7.0 torchvision numpy==1.26.4')
603599

604600
if rocm.is_wsl:
605601
rocm.load_hsa_runtime()

requirements.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ inflection
1414
jsonmerge
1515
kornia
1616
lark
17-
numpy
17+
numpy<2
1818
omegaconf
1919
open-clip-torch
2020

requirements_versions.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,12 +15,12 @@ inflection==0.5.1
1515
jsonmerge==1.8.0
1616
kornia==0.6.7
1717
lark==1.1.2
18-
numpy==1.26.2
18+
numpy==1.26.4
1919
omegaconf==2.2.3
2020
open-clip-torch==2.20.0
2121
onnx==1.16.2
2222
onnxruntime
23-
optimum
23+
optimum==1.25.3
2424
olive-ai
2525
piexif==1.1.3
2626
protobuf==3.20.2

0 commit comments

Comments
 (0)