stable-diffusion-webui icon indicating copy to clipboard operation
stable-diffusion-webui copied to clipboard

[Bug]: RuntimeError: self.size(-1) must be divisible by 4 to view Byte as Float (different element sizes), but got 5910330

Open Andre-xue opened this issue 2 years ago • 1 comments

Is there an existing issue for this?

  • [X] I have searched the existing issues and checked the recent builds/commits

What happened?

venv "D:\AIpainting\venv\Scripts\Python.exe" Python 3.10.9 | packaged by Anaconda, Inc. | (main, Mar 1 2023, 18:18:15) [MSC v.1916 64 bit (AMD64)] Commit hash: 22bcc7be428c94e9408f589966c2040187245d81 Installing requirements for Web UI Launching Web UI with arguments: No module 'xformers'. Proceeding without it. Loading weights [1effcade9b] from D:\AIpainting\models\Stable-diffusion\v1-5-pruned-emaonly.safetensors loading stable diffusion model: RuntimeError Traceback (most recent call last): File "D:\AIpainting\webui.py", line 139, in initialize modules.sd_models.load_model() File "D:\AIpainting\modules\sd_models.py", line 415, in load_model state_dict = get_checkpoint_state_dict(checkpoint_info, timer) File "D:\AIpainting\modules\sd_models.py", line 262, in get_checkpoint_state_dict res = read_state_dict(checkpoint_info.filename) File "D:\AIpainting\modules\sd_models.py", line 241, in read_state_dict pl_sd = safetensors.torch.load_file(checkpoint_file, device=device) File "D:\AIpainting\venv\lib\site-packages\safetensors-0.3.0-py3.10-win-amd64.egg\safetensors\torch.py", line 101, in load_file result[k] = f.get_tensor(k) RuntimeError: self.size(-1) must be divisible by 4 to view Byte as Float (different element sizes), but got 5910330

Stable diffusion model failed to load, exiting 请按任意键继续. . .

Steps to reproduce the problem

What should have happened?

Commit where the problem happens

venv "D:\AIpainting\venv\Scripts\Python.exe" Python 3.10.9 | packaged by Anaconda, Inc. | (main, Mar 1 2023, 18:18:15) [MSC v.1916 64 bit (AMD64)] Commit hash: 22bcc7be428c94e9408f589966c2040187245d81 Installing requirements for Web UI Launching Web UI with arguments: No module 'xformers'. Proceeding without it. Loading weights [1effcade9b] from D:\AIpainting\models\Stable-diffusion\v1-5-pruned-emaonly.safetensors loading stable diffusion model: RuntimeError Traceback (most recent call last): File "D:\AIpainting\webui.py", line 139, in initialize modules.sd_models.load_model() File "D:\AIpainting\modules\sd_models.py", line 415, in load_model state_dict = get_checkpoint_state_dict(checkpoint_info, timer) File "D:\AIpainting\modules\sd_models.py", line 262, in get_checkpoint_state_dict res = read_state_dict(checkpoint_info.filename) File "D:\AIpainting\modules\sd_models.py", line 241, in read_state_dict pl_sd = safetensors.torch.load_file(checkpoint_file, device=device) File "D:\AIpainting\venv\lib\site-packages\safetensors-0.3.0-py3.10-win-amd64.egg\safetensors\torch.py", line 101, in load_file result[k] = f.get_tensor(k) RuntimeError: self.size(-1) must be divisible by 4 to view Byte as Float (different element sizes), but got 5910330 Stable diffusion model failed to load, exiting 请按任意键继续. . .

What platforms do you use to access the UI ?

Windows

What browsers do you use to access the UI ?

Google Chrome

Command Line Arguments

List of extensions

Console logs

venv "D:\AIpainting\venv\Scripts\Python.exe"
Python 3.10.9 | packaged by Anaconda, Inc. | (main, Mar  1 2023, 18:18:15) [MSC v.1916 64 bit (AMD64)]
Commit hash: 22bcc7be428c94e9408f589966c2040187245d81
Installing requirements for Web UI
Launching Web UI with arguments:
No module 'xformers'. Proceeding without it.
Loading weights [1effcade9b] from D:\AIpainting\models\Stable-diffusion\v1-5-pruned-emaonly.safetensors
loading stable diffusion model: RuntimeError
Traceback (most recent call last):
  File "D:\AIpainting\webui.py", line 139, in initialize
    modules.sd_models.load_model()
  File "D:\AIpainting\modules\sd_models.py", line 415, in load_model
    state_dict = get_checkpoint_state_dict(checkpoint_info, timer)
  File "D:\AIpainting\modules\sd_models.py", line 262, in get_checkpoint_state_dict
    res = read_state_dict(checkpoint_info.filename)
  File "D:\AIpainting\modules\sd_models.py", line 241, in read_state_dict
    pl_sd = safetensors.torch.load_file(checkpoint_file, device=device)
  File "D:\AIpainting\venv\lib\site-packages\safetensors-0.3.0-py3.10-win-amd64.egg\safetensors\torch.py", line 101, in load_file
    result[k] = f.get_tensor(k)
RuntimeError: self.size(-1) must be divisible by 4 to view Byte as Float (different element sizes), but got 5910330


Stable diffusion model failed to load, exiting
请按任意键继续. . .

Additional information

Andre-xue avatar Apr 03 '23 17:04 Andre-xue

hi, this helped me https://github.com/AUTOMATIC1111/stable-diffusion-webui/discussions/8132

florianwachs avatar Apr 16 '23 08:04 florianwachs

Duplicate of https://github.com/AUTOMATIC1111/stable-diffusion-webui/issues/8653

catboxanon avatar Aug 11 '23 16:08 catboxanon