-
Notifications
You must be signed in to change notification settings - Fork 427
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
Error when running in CPU mode #70
Comments
Same here on Windows, fresh environment |
Same problem on Linux Mint. It looks like problem is located in pretrained model types, CLIP, transformers and/or PyTorch. Pretrained models was saved at float16 (see |
i am having the same problem, it worked on some crapy intel cpu but not on my amd one |
any options for a workaround? my RAM is substantially larger than my GPU memory lol |
i am having the same problem |
Hi all i have a simple "fix" for those who have this error if they want to use cpu. def convert_weights(model: nn.Module):
"""Convert applicable model parameters to fp16"""
def _convert_weights_to_fp16(l):
"""
if isinstance(l, (nn.Conv1d, nn.Conv2d, nn.Linear)):
l.weight.data = l.weight.data.half()
if l.bias is not None:
l.bias.data = l.bias.data.half()
if isinstance(l, nn.MultiheadAttention):
for attr in [*[f"{s}_proj_weight" for s in ["in", "q", "k", "v"]], "in_proj_bias", "bias_k", "bias_v"]:
tensor = getattr(l, attr)
if tensor is not None:
tensor.data = tensor.data.half()
for name in ["text_projection", "proj"]:
if hasattr(l, name):
attr = getattr(l, name)
if attr is not None:
attr.data = attr.data.half()
"""
pass
model.apply(_convert_weights_to_fp16) then it works. (or simply delete it if you dont plan on using gpu mode later again) |
@dehaenw Thank you for your answer, I tried it out, the code is running but produced images are all kind of white noises, did you experience similar behaviour or everything was working fine? |
@FlavioLeccese92 It works for me, however it is very slow (~10x slower than an old gpu in my task), otherwise i did not notice any unusual noise except the initialized image before it converges to target |
@dehaenw by unusual you mean something like this? |
@FlavioLeccese92 no, not like your example image, which looks like the colors are somehow clipped or restricted to rgb values of 0 or 255 only per color. my initialized images just look like this: |
Bug
I get
RuntimeError: "softmax_lastdim_kernel_impl" not implemented for 'Half'
when running this against my CPU.To reproduce
Gives
Expected behavior
No error; generate an output image.
Additional notes
-cd cpu
parameterEnvironment
The text was updated successfully, but these errors were encountered: