Skip to content

Commit

Permalink
fix: multi-gpu ddp collective mismatch upon resume
Browse files Browse the repository at this point in the history
  • Loading branch information
beniz committed May 9, 2024
1 parent 54a6ab4 commit 471fbbc
Showing 1 changed file with 6 additions and 7 deletions.
13 changes: 6 additions & 7 deletions train.py
Original file line number Diff line number Diff line change
Expand Up @@ -127,14 +127,13 @@ def train_gpu(rank, world_size, opt, trainset, trainset_temporal):
if opt.output_display_env == "":
opt.output_display_env = opt.name

if rank_0:
visualizer = Visualizer(
opt
) # create a visualizer that display/save images and plots
visualizer = Visualizer(
opt
) # create a visualizer that display/save images and plots

if opt.train_continue:
opt.train_epoch_count = visualizer.load_data()
opt.total_iters = opt.train_epoch_count * trainset_size
if opt.train_continue:
opt.train_epoch_count = visualizer.load_data()
opt.total_iters = opt.train_epoch_count * trainset_size

opt.optim = optim # set optimizer
model = create_model(opt, rank) # create a model given opt.model and other options
Expand Down

0 comments on commit 471fbbc

Please sign in to comment.