declare-lab / tango

A family of diffusion models for text-to-audio generation.

Home Page:https://tango2-web.github.io/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

AttributeError: 'AudioDiffusion' object has no attribute 'device'

fyell opened this issue · comments

Hi,

I am trying to run the following command from the README.md

accelerate launch train.py \
--text_encoder_name="google/flan-t5-large" \
--scheduler_name="stabilityai/stable-diffusion-2-1" \
--unet_model_config="configs/diffusion_model_config.json" \
--freeze_text_encoder --augment --snr_gamma 5 \

However, I am getting this AttributeError

Traceback (most recent call last):
  File "/Users/fielguhit/Workspace/tango/train.py", line 534, in <module>
    main()
  File "/Users/fielguhit/Workspace/tango/train.py", line 434, in main
    device = model.device
  File "/Users/fielguhit/.pyenv/versions/3.10.10/lib/python3.10/site-packages/torch/nn/modules/module.py", line 1269, in __getattr__
    raise AttributeError("'{}' object has no attribute '{}'".format(
AttributeError: 'AudioDiffusion' object has no attribute 'device'

Can you please advise?

What is your torch version and how did you install it?

It's version 1.13.1

I installed it with pip install -r requirements.txt

Have you setup the accelerate config as specified here?

It should work after that. Otherwise, you may also try changing the
device = model.device to device = accelerator.device in train.py

Yes. I ran accelerate config and still ran into the issue.

However, I did update train.py to use device = accelerator.device instead of model.device and it seems to have worked!

Thanks!