Open nbanyan opened 2 years ago
Just comment out safety_checker=None,
in both places it exists, this worked for me
Not sure why I didn't look for that variable in train_dreambooth.py
. That is an easier fix for most users. Personally, I prefer the utility scripts to be more robust against random inputs.
Update: removing safety_checker=None
in train_dreambooth.py or/and handling it in the utils gives me an error when loading the checkpoint (after converting the training output for stable diffusion). What type of object is the safety_checker expecting?
Loading weights [9453d9a1] from D:\Downloads\stable-diffusion-webui\models\Stable-diffusion\training_output.ckpt
Error verifying pickled file from D:\Downloads\stable-diffusion-webui\models\Stable-diffusion\training_output.ckpt:
Traceback (most recent call last):
File "D:\Downloads\stable-diffusion-webui\modules\safe.py", line 97, in load
check_pt(filename)
File "D:\Downloads\stable-diffusion-webui\modules\safe.py", line 77, in check_pt
check_zip_filenames(filename, z.namelist())
File "D:\Downloads\stable-diffusion-webui\modules\safe.py", line 69, in check_zip_filenames
raise Exception(f"bad file inside {filename}: {name}")
Exception: bad file inside D:\Downloads\stable-diffusion-webui\models\Stable-diffusion\training_output.ckpt: training_output/data.pkl
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 "D:\Downloads\stable-diffusion-webui\venv\lib\site-packages\gradio\routes.py", line 275, in run_predict
output = await app.blocks.process_api(
File "D:\Downloads\stable-diffusion-webui\venv\lib\site-packages\gradio\blocks.py", line 787, in process_api
result = await self.call_function(fn_index, inputs, iterator)
File "D:\Downloads\stable-diffusion-webui\venv\lib\site-packages\gradio\blocks.py", line 694, in call_function
prediction = await anyio.to_thread.run_sync(
File "D:\Downloads\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 "D:\Downloads\stable-diffusion-webui\venv\lib\site-packages\anyio\_backends\_asyncio.py", line 937, in run_sync_in_worker_thread
return await future
File "D:\Downloads\stable-diffusion-webui\venv\lib\site-packages\anyio\_backends\_asyncio.py", line 867, in run
result = context.run(func, *args)
File "D:\Downloads\stable-diffusion-webui\modules\ui.py", line 1736, in <lambda>
fn=lambda value, k=k: run_settings_single(value, key=k),
File "D:\Downloads\stable-diffusion-webui\modules\ui.py", line 1591, in run_settings_single
opts.data_labels[key].onchange()
File "D:\Downloads\stable-diffusion-webui\webui.py", line 40, in f
res = func(*args, **kwargs)
File "D:\Downloads\stable-diffusion-webui\webui.py", line 85, in <lambda>
shared.opts.onchange("sd_model_checkpoint", wrap_queued_call(lambda: modules.sd_models.reload_model_weights(shared.sd_model)))
File "D:\Downloads\stable-diffusion-webui\modules\sd_models.py", line 265, in reload_model_weights
load_model_weights(sd_model, checkpoint_info)
File "D:\Downloads\stable-diffusion-webui\modules\sd_models.py", line 169, in load_model_weights
if "global_step" in pl_sd:
TypeError: argument of type 'NoneType' is not iterable
To fix the below console output and error, I have added
if (save_method_name is not None):
in thesave_pretrained
method before line 194 in pipeline_utils.py to cause it to skip trying to save safety_checker when it is(None, None)
.Modified
pipeline_utils.py
:Console output before modification:
Reproduction
No response
Logs
No response
System Info
diffusers
version: 0.7.0.dev0Accelerate
version: 0.12.0Accelerate
default config: