Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

TypeError: load_checkpoint_and_dispatch() got an unexpected keyword argument 'force_hooks' #67

Open
RC-Hong opened this issue Sep 8, 2024 · 3 comments

Comments

@RC-Hong
Copy link

RC-Hong commented Sep 8, 2024

Run python test_pasd_sdxl.py
Traceback (most recent call last):
File "D:\PASD\test_pasd_sdxl.py", line 319, in
main(args)
File "D:\PASD\test_pasd_sdxl.py", line 206, in main
pipeline, refiner_pipeline = load_pasd_pipeline(args, accelerator, enable_xformers_memory_efficient_attention)
File "D:\PASD\test_pasd_sdxl.py", line 59, in load_pasd_pipeline
unet = UNet2DConditionModel.from_pretrained(f"{args.pasd_model_path}/unet")
File "D:\python\lib\site-packages\huggingface_hub\utils_validators.py", line 114, in _inner_fn
return fn(*args, **kwargs)
File "D:\python\lib\site-packages\diffusers\models\modeling_utils.py", line 774, in from_pretrained
accelerate.load_checkpoint_and_dispatch(
TypeError: load_checkpoint_and_dispatch() got an unexpected keyword argument 'force_hooks'
#=============================#
And edit gradio_pasd.py to
pretrained_model_path = "checkpoints/stable-diffusion-xl-base-1.0" #stable-diffusion-v1-5"
ckpt_path = "runs/pasd_sdxl/checkpoint-200000" #pasd/checkpoint-100000"
dreambooth_lora_path = "checkpoints/personalized_models/sdxl_lcm_lora.safetensors" #majicmixRealistic_v6.safetensors"
#feature_extractor = CLIPImageProcessor.from_pretrained(f"{pretrained_model_path}/feature_extractor")

Run python gradio_pasd.py
D:\python\lib\site-packages\torchvision\models_utils.py:208: UserWarning: The parameter 'pretrained' is deprecated since 0.13 and may be removed in the future, please use 'weights' instead.
warnings.warn(
D:\python\lib\site-packages\torchvision\models_utils.py:223: UserWarning: Arguments other than a weight enum or None for 'weights' are deprecated since 0.13 and may be removed in the future. The current behavior is equivalent to passing weights=None.
warnings.warn(msg)
Traceback (most recent call last):
File "D:\PASD\gradio_pasd.py", line 43, in
unet = UNet2DConditionModel.from_pretrained(ckpt_path, subfolder="unet")
File "D:\python\lib\site-packages\huggingface_hub\utils_validators.py", line 114, in _inner_fn
return fn(*args, **kwargs)
File "D:\python\lib\site-packages\diffusers\models\modeling_utils.py", line 774, in from_pretrained
accelerate.load_checkpoint_and_dispatch(
TypeError: load_checkpoint_and_dispatch() got an unexpected keyword argument 'force_hooks'

@yangxy
Copy link
Owner

yangxy commented Sep 9, 2024

Update diffusers to the latest version.

@RC-Hong
Copy link
Author

RC-Hong commented Sep 9, 2024

installed diffusers-0.30.2
but still TypeError: load_checkpoint_and_dispatch() got an unexpected keyword argument 'force_hooks'

@yangxy
Copy link
Owner

yangxy commented Sep 9, 2024

Update accelerate to the latest version.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants