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

[Bug]: new ckpt merge won't load. labed unsafe to unpickle error

Open silverrowan 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?

tried to load newly made merge (using this webui, of f2222 and anything v3) and got "Error verifying pickled file" both parent ckpts load fine

Steps to reproduce the problem

1 -make merge in a1111 webui 2- attempt to load new model (via both top left dropdown, and x/y changecheckpoints) 3- error!

What should have happened?

loaded model. presumably it should be safe if both parents are (or at least should read the same ;) )

Commit where the problem happens

98947d173e3f1667eba29c904f681047dea9de90

What platforms do you use to access UI ?

Windows

What browsers do you use to access the UI ?

Mozilla Firefox

Command Line Arguments

--autolaunch --api git pull

Additional information, context and logs

Loading weights [e3b0c442] from C:\Users\Mariah\stable-diffusion-webui\models\Stable-diffusion\f2222-20_aV3-80_float16weighted.ckpt Error verifying pickled file from C:\Users\Mariah\stable-diffusion-webui\models\Stable-diffusion\f2222-20_aV3-80_float16weighted.ckpt: Traceback (most recent call last): File "C:\Users\Mariah\stable-diffusion-webui\modules\safe.py", line 83, in check_pt with zipfile.ZipFile(filename) as z: File "C:\Users\Mariah\AppData\Local\Programs\Python\Python310\lib\zipfile.py", line 1267, in init self._RealGetContents() File "C:\Users\Mariah\AppData\Local\Programs\Python\Python310\lib\zipfile.py", line 1334, in _RealGetContents raise BadZipFile("File is not a zip file") zipfile.BadZipFile: File is not a zip file

During handling of the above exception, another exception occurred:

Traceback (most recent call last): File "C:\Users\Mariah\stable-diffusion-webui\modules\safe.py", line 131, in load_with_extra check_pt(filename, extra_handler) File "C:\Users\Mariah\stable-diffusion-webui\modules\safe.py", line 98, in check_pt unpickler.load() EOFError: Ran out of input

The file may be malicious, so the program is not going to read it. You can skip this check with --disable-safe-unpickle commandline argument.

Traceback (most recent call last): File "C:\Users\Mariah\stable-diffusion-webui\venv\lib\site-packages\gradio\routes.py", line 284, in run_predict output = await app.blocks.process_api( File "C:\Users\Mariah\stable-diffusion-webui\venv\lib\site-packages\gradio\blocks.py", line 982, in process_api result = await self.call_function(fn_index, inputs, iterator) File "C:\Users\Mariah\stable-diffusion-webui\venv\lib\site-packages\gradio\blocks.py", line 824, in call_function prediction = await anyio.to_thread.run_sync( File "C:\Users\Mariah\stable-diffusion-webui\venv\lib\site-packages\anyio\to_thread.py", line 31, in run_sync return await get_asynclib().run_sync_in_worker_thread( File "C:\Users\Mariah\stable-diffusion-webui\venv\lib\site-packages\anyio_backends_asyncio.py", line 937, in run_sync_in_worker_thread return await future File "C:\Users\Mariah\stable-diffusion-webui\venv\lib\site-packages\anyio_backends_asyncio.py", line 867, in run result = context.run(func, *args) File "C:\Users\Mariah\stable-diffusion-webui\modules\ui.py", line 1662, in fn=lambda value, k=k: run_settings_single(value, key=k), File "C:\Users\Mariah\stable-diffusion-webui\modules\ui.py", line 1504, in run_settings_single opts.data_labels[key].onchange() File "C:\Users\Mariah\stable-diffusion-webui\webui.py", line 41, in f res = func(*args, **kwargs) File "C:\Users\Mariah\stable-diffusion-webui\webui.py", line 83, in shared.opts.onchange("sd_model_checkpoint", wrap_queued_call(lambda: modules.sd_models.reload_model_weights())) File "C:\Users\Mariah\stable-diffusion-webui\modules\sd_models.py", line 295, in reload_model_weights load_model_weights(sd_model, checkpoint_info) File "C:\Users\Mariah\stable-diffusion-webui\modules\sd_models.py", line 184, in load_model_weights if "global_step" in pl_sd: TypeError: argument of type 'NoneType' is not iterable

silverrowan avatar Nov 14 '22 05:11 silverrowan

added commandline arg: --disable-safe-unpickle still will not load merge files. new log:

Loading weights [e3b0c442] from C:\Users\Mariah\stable-diffusion-webui\models\Stable-diffusion\f2222-20_aV3-80_float16weighted.ckpt Traceback (most recent call last): File "C:\Users\Mariah\stable-diffusion-webui\venv\lib\site-packages\gradio\routes.py", line 284, in run_predict output = await app.blocks.process_api( File "C:\Users\Mariah\stable-diffusion-webui\venv\lib\site-packages\gradio\blocks.py", line 982, in process_api result = await self.call_function(fn_index, inputs, iterator) File "C:\Users\Mariah\stable-diffusion-webui\venv\lib\site-packages\gradio\blocks.py", line 824, in call_function prediction = await anyio.to_thread.run_sync( File "C:\Users\Mariah\stable-diffusion-webui\venv\lib\site-packages\anyio\to_thread.py", line 31, in run_sync return await get_asynclib().run_sync_in_worker_thread( File "C:\Users\Mariah\stable-diffusion-webui\venv\lib\site-packages\anyio_backends_asyncio.py", line 937, in run_sync_in_worker_thread return await future File "C:\Users\Mariah\stable-diffusion-webui\venv\lib\site-packages\anyio_backends_asyncio.py", line 867, in run result = context.run(func, *args) File "C:\Users\Mariah\stable-diffusion-webui\modules\ui.py", line 1662, in fn=lambda value, k=k: run_settings_single(value, key=k), File "C:\Users\Mariah\stable-diffusion-webui\modules\ui.py", line 1504, in run_settings_single opts.data_labels[key].onchange() File "C:\Users\Mariah\stable-diffusion-webui\webui.py", line 41, in f res = func(*args, **kwargs) File "C:\Users\Mariah\stable-diffusion-webui\webui.py", line 83, in shared.opts.onchange("sd_model_checkpoint", wrap_queued_call(lambda: modules.sd_models.reload_model_weights())) File "C:\Users\Mariah\stable-diffusion-webui\modules\sd_models.py", line 295, in reload_model_weights load_model_weights(sd_model, checkpoint_info) File "C:\Users\Mariah\stable-diffusion-webui\modules\sd_models.py", line 183, in load_model_weights pl_sd = torch.load(checkpoint_file, map_location=shared.weight_load_location) File "C:\Users\Mariah\stable-diffusion-webui\modules\safe.py", line 102, in load return load_with_extra(filename, *args, **kwargs) File "C:\Users\Mariah\stable-diffusion-webui\modules\safe.py", line 147, in load_with_extra return unsafe_torch_load(filename, *args, **kwargs) File "C:\Users\Mariah\stable-diffusion-webui\venv\lib\site-packages\torch\serialization.py", line 713, in load return _legacy_load(opened_file, map_location, pickle_module, **pickle_load_args) File "C:\Users\Mariah\stable-diffusion-webui\venv\lib\site-packages\torch\serialization.py", line 920, in _legacy_load magic_number = pickle_module.load(f, **pickle_load_args) EOFError: Ran out of input

silverrowan avatar Nov 14 '22 05:11 silverrowan

EOFError: Ran out of input

Any chance of broken / truncated model file?

aleksusklim avatar Nov 16 '22 05:11 aleksusklim

Same error here

OedoSoldier avatar Nov 17 '22 11:11 OedoSoldier

Command Line Arguments --autolaunch --api git pull

is git pull a valid arg to add even? does it work without it added?

nagaisa avatar Nov 17 '22 13:11 nagaisa

This happens when a merge fails to get created properly, if you open the .ckpt with winrar/7zip inside should be a folder, the folders name should be archive... if it is not then it doesn't load. A workaround for this is to put the custom output model name to archive and then rename the ckpt after its been merged. I don't have this trouble in a1111 but ran into it a couple of times with another merger. Seemed to happen when running low on RAM during the merge.

Vetchems avatar Nov 22 '22 13:11 Vetchems

File is corrupted, probably.

mezotaken avatar Jan 30 '23 08:01 mezotaken