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

多卡训练报错 #42

Open
KaiGod0730 opened this issue Mar 18, 2024 · 2 comments
Open

多卡训练报错 #42

KaiGod0730 opened this issue Mar 18, 2024 · 2 comments

Comments

@KaiGod0730
Copy link

感谢您的工作!
我现在使用单卡训练没有问题,使用多卡训练会出现如下报错:
Traceback (most recent call last):
File "train_svd.py", line 1264, in
main()
File "train_svd.py", line 1045, in main
added_time_ids = _get_add_time_ids(
File "train_svd.py", line 949, in _get_add_time_ids
passed_add_embed_dim = unet.config.addition_time_embed_dim *
File "/.pt2/lib/python3.8/site-packages/torch/nn/modules/module.py", line 1614, in getattr
raise AttributeError("'{}' object has no attribute '{}'".format(
AttributeError: 'DistributedDataParallel' object has no attribute 'config'

我使用的命令:
accelerate launch train_svd.py
--pretrained_model_name_or_path=stable-video-diffusion-img2vid-xt-1-1
--per_gpu_batch_size=1 --gradient_accumulation_steps=1
--max_train_steps=100
--width=512
--height=320
--checkpointing_steps=50 --checkpoints_total_limit=1
--learning_rate=1e-5 --lr_warmup_steps=0
--seed=123
--mixed_precision="fp16"
--validation_steps=20
--num_workers=0 \

@howardgriffin
Copy link

Same error, how to solve the problem?

@LTT-O
Copy link

LTT-O commented May 30, 2024

unet.config.addition_time_embed_dim加个module,unet.module.config.addition_time_embed_dim

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