Skip to content

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

@xinyu-pu

Description

@xinyu-pu

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]])"

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions