CompVis/stable-diffusion

the img2img scripts can't work

haye123 opened this issue · 0 comments

I ran the script on the server without making any changes to the actual code, but an error occurred.

Traceback (most recent call last): File "scripts/img2img.py", line 293, in <module> main() File "scripts/img2img.py", line 261, in main samples = sampler.decode(z_enc, c, t_enc, unconditional_guidance_scale=opt.scale, File "/opt/data/private/anaconda3/envs/ldm/lib/python3.8/site-packages/torch/autograd/grad_mode.py", line 27, in decorate_context return func(*args, **kwargs) File "/opt/data/private/stable-diffusion/ldm/models/diffusion/ddim.py", line 238, in decode x_dec, _ = self.p_sample_ddim(x_dec, cond, ts, index=index, use_original_steps=use_original_steps, File "/opt/data/private/anaconda3/envs/ldm/lib/python3.8/site-packages/torch/autograd/grad_mode.py", line 27, in decorate_context return func(*args, **kwargs) File "/opt/data/private/stable-diffusion/ldm/models/diffusion/ddim.py", line 177, in p_sample_ddim e_t_uncond, e_t = self.model.apply_model(x_in, t_in, c_in).chunk(2) File "/opt/data/private/stable-diffusion/ldm/models/diffusion/ddpm.py", line 987, in apply_model x_recons = self.model(x_noisy, t, **cond) File "/opt/data/private/anaconda3/envs/ldm/lib/python3.8/site-packages/torch/nn/modules/module.py", line 1110, in _call_impl return forward_call(*input, **kwargs) File "/opt/data/private/stable-diffusion/ldm/models/diffusion/ddpm.py", line 1410, in forward out = self.diffusion_model(x, t, context=cc) File "/opt/data/private/anaconda3/envs/ldm/lib/python3.8/site-packages/torch/nn/modules/module.py", line 1110, in _call_impl return forward_call(*input, **kwargs) File "/opt/data/private/stable-diffusion/ldm/modules/diffusionmodules/openaimodel.py", line 736, in forward h = th.cat([h, hs.pop()], dim=1) RuntimeError: Sizes of tensors must match except in dimension 1. Expected size 18 but got size 17 for tensor number 1 in the list. (
but i didn't change any。