"RuntimeError: expected scalar type Half but found Float " when using fp16 #13

by qpoisson - opened

pipe = StableDiffusionInpaintPipeline.from_pretrained(
"runwayml/stable-diffusion-inpainting",
use_auth_token = TOKEN,
revision="fp16",
torch_dtype=torch.float16
).to('cuda')

(Loaded to GPU memory successfully.)

Using fp16 as above caused : "RuntimeError: expected scalar type Half but found Float "

at

python3.10/site-packages/transformers/models/clip/modeling_clip.py", line 259, in forward
attn_output = torch.bmm(attn_probs, value_states)

Hey, I had the same problem. What solved it for me was installing the requirements they had used in the notebook:

pip install -qq -U diffusers==0.6.0 transformers ftfy gradio
pip install git+https://github.com/huggingface/diffusers.git
This comment has been hidden
qpoisson changed discussion status to closed
qpoisson changed discussion status to open

Sign up or log in to comment