mirror of
https://github.com/kohya-ss/sd-scripts.git
synced 2026-04-09 06:45:09 +00:00
support DistributedDataParallel
This commit is contained in:
@@ -267,6 +267,14 @@ def train(args):
|
|||||||
unet.eval()
|
unet.eval()
|
||||||
text_encoder.eval()
|
text_encoder.eval()
|
||||||
|
|
||||||
|
# support DistributedDataParallel
|
||||||
|
try:
|
||||||
|
text_encoder = text_encoder.module
|
||||||
|
unet = unet.module
|
||||||
|
network = network.module
|
||||||
|
except:
|
||||||
|
pass
|
||||||
|
|
||||||
network.prepare_grad_etc(text_encoder, unet)
|
network.prepare_grad_etc(text_encoder, unet)
|
||||||
|
|
||||||
if not cache_latents:
|
if not cache_latents:
|
||||||
|
|||||||
Reference in New Issue
Block a user