#17055[Bug]: Issue with Numpy when starting webui

HiroYuan-DAICHIGPHiroYuan-DAICHIGP
opened 3 months ago
Author

Checklist

  • The issue exists after disabling all extensions
  • The issue exists on a clean installation of webui
  • The issue is caused by an extension, but I believe it is caused by a bug in the webui
  • The issue exists in the current version of the webui
  • The issue has not been reported before recently
  • The issue has been reported before but has not been fixed yet

What happened?

I was using webui for long time. But today, I found that launching webui.bat will fail with following error message...

A module that was compiled using NumPy 1.x cannot be run in NumPy 2.2.6 as it may crash. To support both 1.x and 2.x versions of NumPy, modules must be compiled with NumPy 2.0. Some module may need to rebuild instead e.g. with 'pybind11>=2.12'.

I didn't change any cofiguration but this happen suddenly. Removing venv and reinstall not fixing this issue

Steps to reproduce the problem

Double click webui.bat

What should have happened?

Should be able to normally use webui

What browsers do you use to access the UI ?

Google Chrome

Sysinfo

Cannot launch webui

Console logs

A module that was compiled using NumPy 1.x cannot be run in NumPy 2.2.6 as it may crash. To support both 1.x and 2.x versions of NumPy, modules must be compiled with NumPy 2.0. Some module may need to rebuild instead e.g. with 'pybind11>=2.12'. If you are a user of the module, the easiest solution will be to downgrade to 'numpy<2' or try to upgrade the affected module. We expect that some modules will need time to support NumPy 2. Traceback (most recent call last): File "C:\Users\teche\Documents\Stable Diffusion\stable-diffusion-webui\launch.py", line 48, in <module> main() File "C:\Users\teche\Documents\Stable Diffusion\stable-diffusion-webui\launch.py", line 44, in main start() File "C:\Users\teche\Documents\Stable Diffusion\stable-diffusion-webui\modules\launch_utils.py", line 465, in start import webui File "C:\Users\teche\Documents\Stable Diffusion\stable-diffusion-webui\webui.py", line 13, in <module> initialize.imports() File "C:\Users\teche\Documents\Stable Diffusion\stable-diffusion-webui\modules\initialize.py", line 15, in imports import torch # noqa: F401 File "C:\Users\teche\Documents\Stable Diffusion\stable-diffusion-webui\venv\lib\site-packages\torch\__init__.py", line 1382, in <module> from .functional import * # noqa: F403 File "C:\Users\teche\Documents\Stable Diffusion\stable-diffusion-webui\venv\lib\site-packages\torch\functional.py", line 7, in <module> import torch.nn.functional as F File "C:\Users\teche\Documents\Stable Diffusion\stable-diffusion-webui\venv\lib\site-packages\torch\nn\__init__.py", line 1, in <module> from .modules import * # noqa: F403 File "C:\Users\teche\Documents\Stable Diffusion\stable-diffusion-webui\venv\lib\site-packages\torch\nn\modules\__init__.py", line 35, in <module> from .transformer import TransformerEncoder, TransformerDecoder, \ File "C:\Users\teche\Documents\Stable Diffusion\stable-diffusion-webui\venv\lib\site-packages\torch\nn\modules\transformer.py", line 20, in <module> device: torch.device = torch.device(torch._C._get_default_device()), # torch.device('cpu'), C:\Users\teche\Documents\Stable Diffusion\stable-diffusion-webui\venv\lib\site-packages\torch\nn\modules\transformer.py:20: UserWarning: Failed to initialize NumPy: _ARRAY_API not found (Triggered internally at ..\torch\csrc\utils\tensor_numpy.cpp:84.) device: torch.device = torch.device(torch._C._get_default_device()), # torch.device('cpu'), A module that was compiled using NumPy 1.x cannot be run in NumPy 2.2.6 as it may crash. To support both 1.x and 2.x versions of NumPy, modules must be compiled with NumPy 2.0. Some module may need to rebuild instead e.g. with 'pybind11>=2.12'. If you are a user of the module, the easiest solution will be to downgrade to 'numpy<2' or try to upgrade the affected module. We expect that some modules will need time to support NumPy 2. Traceback (most recent call last): File "C:\Users\teche\Documents\Stable Diffusion\stable-diffusion-webui\launch.py", line 48, in <module> main() File "C:\Users\teche\Documents\Stable Diffusion\stable-diffusion-webui\launch.py", line 44, in main start() File "C:\Users\teche\Documents\Stable Diffusion\stable-diffusion-webui\modules\launch_utils.py", line 465, in start import webui File "C:\Users\teche\Documents\Stable Diffusion\stable-diffusion-webui\webui.py", line 13, in <module> initialize.imports() File "C:\Users\teche\Documents\Stable Diffusion\stable-diffusion-webui\modules\initialize.py", line 17, in imports import pytorch_lightning # noqa: F401 File "C:\Users\teche\Documents\Stable Diffusion\stable-diffusion-webui\venv\lib\site-packages\pytorch_lightning\__init__.py", line 35, in <module> from pytorch_lightning.callbacks import Callback # noqa: E402 File "C:\Users\teche\Documents\Stable Diffusion\stable-diffusion-webui\venv\lib\site-packages\pytorch_lightning\callbacks\__init__.py", line 14, in <module> from pytorch_lightning.callbacks.batch_size_finder import BatchSizeFinder File "C:\Users\teche\Documents\Stable Diffusion\stable-diffusion-webui\venv\lib\site-packages\pytorch_lightning\callbacks\batch_size_finder.py", line 24, in <module> from pytorch_lightning.callbacks.callback import Callback File "C:\Users\teche\Documents\Stable Diffusion\stable-diffusion-webui\venv\lib\site-packages\pytorch_lightning\callbacks\callback.py", line 25, in <module> from pytorch_lightning.utilities.types import STEP_OUTPUT File "C:\Users\teche\Documents\Stable Diffusion\stable-diffusion-webui\venv\lib\site-packages\pytorch_lightning\utilities\types.py", line 27, in <module> from torchmetrics import Metric File "C:\Users\teche\Documents\Stable Diffusion\stable-diffusion-webui\venv\lib\site-packages\torchmetrics\__init__.py", line 37, in <module> from torchmetrics import functional # noqa: E402 File "C:\Users\teche\Documents\Stable Diffusion\stable-diffusion-webui\venv\lib\site-packages\torchmetrics\functional\__init__.py", line 56, in <module> from torchmetrics.functional.image._deprecated import ( File "C:\Users\teche\Documents\Stable Diffusion\stable-diffusion-webui\venv\lib\site-packages\torchmetrics\functional\image\__init__.py", line 14, in <module> from torchmetrics.functional.image.arniqa import arniqa File "C:\Users\teche\Documents\Stable Diffusion\stable-diffusion-webui\venv\lib\site-packages\torchmetrics\functional\image\arniqa.py", line 31, in <module> from torchvision import transforms File "C:\Users\teche\Documents\Stable Diffusion\stable-diffusion-webui\venv\lib\site-packages\torchvision\__init__.py", line 6, in <module> from torchvision import _meta_registrations, datasets, io, models, ops, transforms, utils File "C:\Users\teche\Documents\Stable Diffusion\stable-diffusion-webui\venv\lib\site-packages\torchvision\models\__init__.py", line 2, in <module> from .convnext import * File "C:\Users\teche\Documents\Stable Diffusion\stable-diffusion-webui\venv\lib\site-packages\torchvision\models\convnext.py", line 8, in <module> from ..ops.misc import Conv2dNormActivation, Permute File "C:\Users\teche\Documents\Stable Diffusion\stable-diffusion-webui\venv\lib\site-packages\torchvision\ops\__init__.py", line 1, in <module> from ._register_onnx_ops import _register_custom_op File "C:\Users\teche\Documents\Stable Diffusion\stable-diffusion-webui\venv\lib\site-packages\torchvision\ops\_register_onnx_ops.py", line 5, in <module> from torch.onnx import symbolic_opset11 as opset11 File "C:\Users\teche\Documents\Stable Diffusion\stable-diffusion-webui\venv\lib\site-packages\torch\onnx\__init__.py", line 57, in <module> from ._internal.onnxruntime import ( File "C:\Users\teche\Documents\Stable Diffusion\stable-diffusion-webui\venv\lib\site-packages\torch\onnx\_internal\onnxruntime.py", line 35, in <module> import onnxruntime # type: ignore[import] File "C:\Users\teche\Documents\Stable Diffusion\stable-diffusion-webui\venv\lib\site-packages\onnxruntime\__init__.py", line 23, in <module> from onnxruntime.capi._pybind_state import ExecutionMode # noqa: F401 File "C:\Users\teche\Documents\Stable Diffusion\stable-diffusion-webui\venv\lib\site-packages\onnxruntime\capi\_pybind_state.py", line 33, in <module> from .onnxruntime_pybind11_state import * # noqa AttributeError: _ARRAY_API not found ImportError: numpy.core.multiarray failed to import The above exception was the direct cause of the following exception: SystemError: <built-in function __import__> returned a result with an exception set no module 'xformers'. Processing without... no module 'xformers'. Processing without... No module 'xformers'. Proceeding without it. A module that was compiled using NumPy 1.x cannot be run in NumPy 2.2.6 as it may crash. To support both 1.x and 2.x versions of NumPy, modules must be compiled with NumPy 2.0. Some module may need to rebuild instead e.g. with 'pybind11>=2.12'. If you are a user of the module, the easiest solution will be to downgrade to 'numpy<2' or try to upgrade the affected module. We expect that some modules will need time to support NumPy 2. Traceback (most recent call last): File "C:\Users\teche\Documents\Stable Diffusion\stable-diffusion-webui\launch.py", line 48, in <module> main() File "C:\Users\teche\Documents\Stable Diffusion\stable-diffusion-webui\launch.py", line 44, in main start() File "C:\Users\teche\Documents\Stable Diffusion\stable-diffusion-webui\modules\launch_utils.py", line 465, in start import webui File "C:\Users\teche\Documents\Stable Diffusion\stable-diffusion-webui\webui.py", line 13, in <module> initialize.imports() File "C:\Users\teche\Documents\Stable Diffusion\stable-diffusion-webui\modules\initialize.py", line 39, in imports from modules import processing, gradio_extensons, ui # noqa: F401 File "C:\Users\teche\Documents\Stable Diffusion\stable-diffusion-webui\modules\processing.py", line 14, in <module> import cv2 File "C:\Users\teche\Documents\Stable Diffusion\stable-diffusion-webui\venv\lib\site-packages\cv2\__init__.py", line 181, in <module> bootstrap() File "C:\Users\teche\Documents\Stable Diffusion\stable-diffusion-webui\venv\lib\site-packages\cv2\__init__.py", line 153, in bootstrap native_module = importlib.import_module("cv2") File "C:\Users\teche\AppData\Local\Programs\Python\Python310\lib\importlib\__init__.py", line 126, in import_module return _bootstrap._gcd_import(name[level:], package, level) AttributeError: _ARRAY_API not found Traceback (most recent call last): File "C:\Users\teche\Documents\Stable Diffusion\stable-diffusion-webui\launch.py", line 48, in <module> main() File "C:\Users\teche\Documents\Stable Diffusion\stable-diffusion-webui\launch.py", line 44, in main start() File "C:\Users\teche\Documents\Stable Diffusion\stable-diffusion-webui\modules\launch_utils.py", line 465, in start import webui File "C:\Users\teche\Documents\Stable Diffusion\stable-diffusion-webui\webui.py", line 13, in <module> initialize.imports() File "C:\Users\teche\Documents\Stable Diffusion\stable-diffusion-webui\modules\initialize.py", line 39, in imports from modules import processing, gradio_extensons, ui # noqa: F401 File "C:\Users\teche\Documents\Stable Diffusion\stable-diffusion-webui\modules\processing.py", line 14, in <module> import cv2 File "C:\Users\teche\Documents\Stable Diffusion\stable-diffusion-webui\venv\lib\site-packages\cv2\__init__.py", line 181, in <module> bootstrap() File "C:\Users\teche\Documents\Stable Diffusion\stable-diffusion-webui\venv\lib\site-packages\cv2\__init__.py", line 153, in bootstrap native_module = importlib.import_module("cv2") File "C:\Users\teche\AppData\Local\Programs\Python\Python310\lib\importlib\__init__.py", line 126, in import_module return _bootstrap._gcd_import(name[level:], package, level) ImportError: numpy.core.multiarray failed to import

Additional information

No response