Yujun-Shi / DragDiffusion

[CVPR2024, Highlight] Official code for DragDiffusion
https://yujun-shi.github.io/projects/dragdiffusion.html
Apache License 2.0
1.17k stars 88 forks source link

TypeError: expected Tensor as element 0 in argument 0, but got NoneType #71

Open xinyu-pu opened 3 months ago

xinyu-pu commented 3 months ago

A TypeError is thrown when I execute "run_eval_point_matching.py".

"/miniconda3/envs/dragdiff3/lib/python3.8/site-packages/diffusers/pipelines/stable_diffusion/pipeline_stable_diffusion.py:307 in _encode_prompt

prompt_embeds = torch.cat([prompt_embeds_tuple[1], prompt_embeds_tuple[0]]) "

It seems that 'prompt_embeds_tuple' is equal to '(prompt_embedding, negative_prompt_embeding)'. However, the 'negative_prompt_embeding' is None in this code. So I modify the above code as follows.

" if prompt_embeds_tuple[1] is None: prompt_embeds = prompt_embeds_tuple[0] elif prompt_embeds_tuple[0] is None: prompt_embeds = prompt_embeds_tuple[1] else: prompt_embeds = torch.cat([prompt_embeds_tuple[1], prompt_embeds_tuple[0]])"

bluoluo commented 1 hour ago

image 我修改了这两处

bluoluo commented 1 hour ago

你的lpips和mean distance指标测试结果和论文上差别大么