ControlNet icon indicating copy to clipboard operation
ControlNet copied to clipboard

train with multi-gpus

Open pokameng opened this issue 2 years ago • 4 comments

@lllyasviel @williamyang1991 @eltociear @camenduru hello bro, Is it possible to train the tutorial_train_sd21.py with multi-GPUs? I have modified the trainer = pl.Trainer(gpus=1, precision=32, callbacks=[logger]) to trainer = pl.Trainer(gpus=4, accelerator='dp,precision=32, callbacks=[logger]) but it doesn't work

Can someone help me?

pokameng avatar Apr 17 '23 07:04 pokameng

What was the error?

sethupavan12 avatar Apr 20 '23 11:04 sethupavan12

I get the same problem

XavierCHEN34 avatar Apr 22 '23 12:04 XavierCHEN34

You'll need to add the distributed strategy to avoid multiple gpus accessing the same files. I used the following arguments and it works for me: trainer = pl.Trainer(strategy="ddp", accelerator="gpu", devices=2, precision=32, callbacks=[logger])

soon-yau avatar May 05 '23 14:05 soon-yau

solve my problem, thx!

You'll need to add the distributed strategy to avoid multiple gpus accessing the same files. I used the following arguments and it works for me: trainer = pl.Trainer(strategy="ddp", accelerator="gpu", devices=2, precision=32, callbacks=[logger])

ningbende avatar May 17 '23 07:05 ningbende