unexpected keyword argument 'strict'

#91
by LD-inform - opened

hi, i have this issue:

/.local/lib/python3.10/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 'strict'

code:

import torch
from diffusers import FluxPipeline

pipe = FluxPipeline.from_pretrained("/path/flux1-dev", torch_dtype=torch.bfloat16)
prompt = "A cat holding a sign that says something"
image = pipe(
prompt,
height=1024,
width=1024,
guidance_scale=3.5,
num_inference_steps=50,
max_sequence_length=512,
generator=torch.Generator(device='cuda').manual_seed(0)
).images[0]

image.save("image.png")

any idea why? i am trying to load it to cuda

Same issue, using model card code.

pip install accelerate -U helps for me.

It fixed for me after creating new python virtualenv and installing dependencies.

Sign up or log in to comment