songweige / rich-text-to-image

Rich-Text-to-Image Generation
https://rich-text-to-image.github.io/
MIT License
749 stars 61 forks source link

code is breaking after new update #11

Open a-lakh opened 11 months ago

a-lakh commented 11 months ago

Traceback (most recent call last): File "sample.py", line 146, in <module> main(args, param) File "sample.py", line 66, in main plain_img = model.produce_attn_maps([base_text_prompt], [negative_text], File "/Users/stark/work/rich-text-to-image/models/region_diffusion.py", line 207, in produce_attn_maps noise_pred = self.unet( File "/Users/stark/miniconda3/envs/myenv/lib/python3.8/site-packages/torch/nn/modules/module.py", line 1501, in _call_impl return forward_call(*args, **kwargs) File "/Users/stark/work/rich-text-to-image/models/unet_2d_condition.py", line 908, in forward sample, res_samples = downsample_block( File "/Users/stark/miniconda3/envs/myenv/lib/python3.8/site-packages/torch/nn/modules/module.py", line 1501, in _call_impl return forward_call(*args, **kwargs) File "/Users/stark/work/rich-text-to-image/models/unet_2d_blocks.py", line 999, in forward hidden_states = attn( File "/Users/stark/miniconda3/envs/myenv/lib/python3.8/site-packages/torch/nn/modules/module.py", line 1501, in _call_impl return forward_call(*args, **kwargs) File "/Users/stark/work/rich-text-to-image/models/transformer_2d.py", line 291, in forward hidden_states = block( File "/Users/stark/miniconda3/envs/myenv/lib/python3.8/site-packages/torch/nn/modules/module.py", line 1501, in _call_impl return forward_call(*args, **kwargs) File "/Users/stark/work/rich-text-to-image/models/attention.py", line 155, in forward attn_output, _ = self.attn1( File "/Users/stark/miniconda3/envs/myenv/lib/python3.8/site-packages/torch/nn/modules/module.py", line 1538, in _call_impl result = forward_call(*args, **kwargs) File "/Users/stark/work/rich-text-to-image/models/attention_processor.py", line 330, in forward return self.processor( TypeError: __call__() got an unexpected keyword argument 'real_attn_probs'

songweige commented 11 months ago

Are you trying to use a different Attention Processor other than the default one? Currently, the implementation of token reweighting only supports the normal attention computation.

Also, may I know the command you used to run?

huangswmt commented 10 months ago

i got the same error,when I first git this project.

songweige commented 10 months ago

Thank you for trying it out! Could you please provide more information so that I can reproduce the error? For example, could you please provide the results of conda list?

wwj1013 commented 9 months ago

My environment is torch=2.0.1+cu118, and the rest of the installation packages are the same as the requirements in your configuration file. Then, the relevant model SDv1.5 of the hugging face is downloaded locally (I'm not sure if it will make a difference), and the command to run is python gradio_app.py

songweige commented 9 months ago

There was an issue when using PyTorch with version >= 2.0.0. I have made an update to fix it. Please let me know if the issue is still there! Thanks!