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

Fatal Error 'unfolded2d_copy not implemented' When Attempting to Run for the First Time #5

Open
DC-19 opened this issue May 2, 2022 · 1 comment

Comments

@DC-19
Copy link

DC-19 commented May 2, 2022

Hello,
I have finished installing CLIP-Guided-Diffusion, but when I run it, this error happens:
Device: cpu
Size: 256
Setting up [LPIPS] perceptual loss: trunk [vgg], v[0.1], spatial [off]
Loading model from: C:\Users\XXXXXX\Anaconda3\envs\cgd\lib\site-packages\lpips\weights\v0.1\vgg.pth
Seed: 1221123546082200
Text prompt: A rope tied in a figure-eight knot
0%| | 0/1000 [00:00<?, ?it/s]
Traceback (most recent call last):
File "C:\Users\XXXXXX\CLIP-Guided-Diffusion\generate_diffuse.py", line 460, in
do_run()
File "C:\Users\XXXXXX\CLIP-Guided-Diffusion\generate_diffuse.py", line 359, in do_run
for j, sample in enumerate(samples):
File "c:\users\XXXXXX\guided-diffusion\guided_diffusion\gaussian_diffusion.py", line 637, in p_sample_loop_progressive
out = sample_fn(
File "c:\users\XXXXXXX\guided-diffusion\guided_diffusion\gaussian_diffusion.py", line 461, in p_sample
out = self.p_mean_variance(
File "c:\users\XXXXXXX\guided-diffusion\guided_diffusion\respace.py", line 91, in p_mean_variance
return super().p_mean_variance(self._wrap_model(model), *args, **kwargs)
File "c:\users\XXXXXX\guided-diffusion\guided_diffusion\gaussian_diffusion.py", line 260, in p_mean_variance
model_output = model(x, self._scale_timesteps(t), **model_kwargs)
File "c:\users\XXXXXX\guided-diffusion\guided_diffusion\respace.py", line 128, in call
return self.model(x, new_ts, **kwargs)
File "C:\Users\XXXXXX\Anaconda3\envs\cgd\lib\site-packages\torch\nn\modules\module.py", line 1051, in _call_impl
return forward_call(*input, **kwargs)
File "c:\users\XXXXX\guided-diffusion\guided_diffusion\unet.py", line 656, in forward
h = module(h, emb)
File "C:\Users\XXXXXX\Anaconda3\envs\cgd\lib\site-packages\torch\nn\modules\module.py", line 1051, in _call_impl
return forward_call(*input, **kwargs)
File "c:\users\XXXXXX\guided-diffusion\guided_diffusion\unet.py", line 77, in forward
x = layer(x)
File "C:\Users\XXXXXX\Anaconda3\envs\cgd\lib\site-packages\torch\nn\modules\module.py", line 1051, in _call_impl
return forward_call(*input, **kwargs)
File "C:\Users\XXXXXX\Anaconda3\envs\cgd\lib\site-packages\torch\nn\modules\conv.py", line 443, in forward
return self._conv_forward(input, self.weight, self.bias)
File "C:\Users\XXXXXX\Anaconda3\envs\cgd\lib\site-packages\torch\nn\modules\conv.py", line 439, in _conv_forward
return F.conv2d(input, weight, bias, self.stride,
RuntimeError: "unfolded2d_copy" not implemented for 'Half'

Any help would be appreciated.

@ZaneA
Copy link

ZaneA commented Jun 26, 2022

In case you didn't find it yet, you can pass -nfp to the script (e.g. python3 generate_diffuse.py -nfp -p "A painting of an apple") to force 32bit floating point instead of half/16bit floating point. This gets things working on a CPU for me (very slowly) :)

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