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

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

Open
xinyu-pu opened this issue Aug 29, 2024 · 3 comments
Open

Comments

@xinyu-pu
Copy link

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
Copy link

bluoluo commented Dec 3, 2024

image
我修改了这两处

@bluoluo
Copy link

bluoluo commented Dec 3, 2024

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

@March-rain233
Copy link

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

我测试的结果差别很大,MD:47.48 LPIPS:0.2

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

3 participants