alibaba / EasyNLP

EasyNLP: A Comprehensive and Easy-to-use NLP Toolkit
Apache License 2.0
2.03k stars 250 forks source link

AttributeError: 'bool' object has no attribute 'copy', cross_attention_kwargs #332

Closed iamjadhav closed 1 year ago

iamjadhav commented 1 year ago

Hi, I'm trying to run the runDiffSynth.py with the Fashion Image Synthesis config file. I'm facing this ControlNet error. Could you help me understand what's going wrong with this? Appreciate it, thanks!

Issue log:

Fetching 15 files: 100% 15/15 [00:58<00:00,  3.89s/it]
Loading pipeline components...: 100% 5/5 [00:29<00:00,  6.00s/it]
10 frames will be rendered
Preparing images for ControlNet: 100% 10/10 [00:06<00:00,  1.64it/s]
Estimating pose: 100% 10/10 [00:20<00:00,  2.10s/it]
Drawing pose: 100% 10/10 [00:00<00:00, 99.34it/s]
Preparing images for ControlNet:   0% 0/1 [00:00<?, ?it/s]/usr/local/lib/python3.10/dist-packages/transformers/pipelines/base.py:1090: UserWarning: You seem to be using the pipelines sequentially on GPU. In order to maximize efficiency please use a dataset
  warnings.warn(
Preparing images for ControlNet: 100% 1/1 [00:00<00:00,  5.78it/s]
Estimating pose: 100% 1/1 [00:02<00:00,  2.35s/it]
Drawing pose: 100% 1/1 [00:00<00:00, 98.17it/s]
Denoising:   0% 0/100 [00:00<?, ?it/s]Traceback (most recent call last):
  File "/content/EasyNLP/diffusion/DiffSynth/run_DiffSynth.py", line 92, in <module>
    results = pipe(
  File "/usr/local/lib/python3.10/dist-packages/torch/utils/_contextlib.py", line 115, in decorate_context
    return func(*args, **kwargs)
  File "/content/EasyNLP/diffusion/DiffSynth/DiffSynth/pipeline.py", line 370, in __call__
    down_res_posi, mid_res_posi = self.controlnet(
  File "/usr/local/lib/python3.10/dist-packages/torch/nn/modules/module.py", line 1501, in _call_impl
    return forward_call(*args, **kwargs)
  File "/content/EasyNLP/diffusion/DiffSynth/DiffSynth/pipeline.py", line 54, in forward
    down_samples, mid_sample = controlnet(
  File "/usr/local/lib/python3.10/dist-packages/torch/nn/modules/module.py", line 1501, in _call_impl
    return forward_call(*args, **kwargs)
  File "/usr/local/lib/python3.10/dist-packages/diffusers/models/controlnet.py", line 760, in forward
    sample, res_samples = downsample_block(
  File "/usr/local/lib/python3.10/dist-packages/torch/nn/modules/module.py", line 1501, in _call_impl
    return forward_call(*args, **kwargs)
  File "/usr/local/lib/python3.10/dist-packages/diffusers/models/unet_2d_blocks.py", line 1053, in forward
    hidden_states = attn(
  File "/usr/local/lib/python3.10/dist-packages/torch/nn/modules/module.py", line 1501, in _call_impl
    return forward_call(*args, **kwargs)
  File "/usr/local/lib/python3.10/dist-packages/diffusers/models/transformer_2d.py", line 309, in forward
    hidden_states = block(
  File "/usr/local/lib/python3.10/dist-packages/torch/nn/modules/module.py", line 1501, in _call_impl
    return forward_call(*args, **kwargs)
  File "/usr/local/lib/python3.10/dist-packages/diffusers/models/attention.py", line 191, in forward
    cross_attention_kwargs = cross_attention_kwargs.copy() if cross_attention_kwargs is not None else {}
AttributeError: 'bool' object has no attribute 'copy'
Denoising:   0% 0/100 [00:00<?, ?it/s]

Note:

/usr/bin/ld: cannot open output file ../bin/ebsynth: No such file or directory collect2: error: ld returned 1 exit status.

Artiprocher commented 1 year ago

Hi @iamjadhav .

We're sorry that our code isn't easy to use. I'm working on a version that doesn't need to be compiled, which may be updated in a few days.

iamjadhav commented 1 year ago

@Artiprocher ,

I had the latest diffusers version I think and 0.0.5 for the controlnet_aux. I'll check if diffusers==0.18.0 solves it. Got it. No worries. It's interesting, all that matters to me. Great, looking forward to it.