🤗 Unofficial huggingface/diffusers-based implementation of the paper "Training-Free Structured Diffusion Guidance for Compositional Text-to-Image Synthesis".
Apache License 2.0
116
stars
5
forks
source link
RuntimeError: Input type (float) and bias type (c10::Half) should be the same #10
Traceback (most recent call last):
File "test.py", line 7, in
image = pipe(prompt, struct_attention="align_seq").images[0]
File "/opt/anaconda3/envs/ldm/lib/python3.8/site-packages/torch/autograd/grad_mode.py", line 27, in decorate_context
return func(*args, kwargs)
File "/data/vjuicefs_hz_cv_enhance_v1/11103392/code/ldm/training-free-structured-diffusion-guidance/tfsdg/pipelines/tfsdg_pipeline.py", line 413, in call
self.unet.to('cuda')
File "/opt/anaconda3/envs/ldm/lib/python3.8/site-packages/torch/nn/modules/module.py", line 1194, in _call_impl
return forward_call(*input, *kwargs)
File "/data/vjuicefs_hz_cv_enhance_v1/11103392/code/ldm/text-to-image/diffusers/src/diffusers/models/unet_2d_condition.py", line 335, in forward
sample = self.conv_in(sample)
File "/opt/anaconda3/envs/ldm/lib/python3.8/site-packages/torch/nn/modules/module.py", line 1194, in _call_impl
return forward_call(input, kwargs)
File "/opt/anaconda3/envs/ldm/lib/python3.8/site-packages/torch/nn/modules/conv.py", line 463, in forward
return self._conv_forward(input, self.weight, self.bias)
File "/opt/anaconda3/envs/ldm/lib/python3.8/site-packages/torch/nn/modules/conv.py", line 459, in _conv_forward
return F.conv2d(input, weight, bias, self.stride,
RuntimeError: Input type (float) and bias type (c10::Half) should be the same
Traceback (most recent call last): File "test.py", line 7, in
image = pipe(prompt, struct_attention="align_seq").images[0]
File "/opt/anaconda3/envs/ldm/lib/python3.8/site-packages/torch/autograd/grad_mode.py", line 27, in decorate_context
return func(*args, kwargs)
File "/data/vjuicefs_hz_cv_enhance_v1/11103392/code/ldm/training-free-structured-diffusion-guidance/tfsdg/pipelines/tfsdg_pipeline.py", line 413, in call
self.unet.to('cuda')
File "/opt/anaconda3/envs/ldm/lib/python3.8/site-packages/torch/nn/modules/module.py", line 1194, in _call_impl
return forward_call(*input, *kwargs)
File "/data/vjuicefs_hz_cv_enhance_v1/11103392/code/ldm/text-to-image/diffusers/src/diffusers/models/unet_2d_condition.py", line 335, in forward
sample = self.conv_in(sample)
File "/opt/anaconda3/envs/ldm/lib/python3.8/site-packages/torch/nn/modules/module.py", line 1194, in _call_impl
return forward_call(input, kwargs)
File "/opt/anaconda3/envs/ldm/lib/python3.8/site-packages/torch/nn/modules/conv.py", line 463, in forward
return self._conv_forward(input, self.weight, self.bias)
File "/opt/anaconda3/envs/ldm/lib/python3.8/site-packages/torch/nn/modules/conv.py", line 459, in _conv_forward
return F.conv2d(input, weight, bias, self.stride,
RuntimeError: Input type (float) and bias type (c10::Half) should be the same
How to solve this problem?