Skip to content

Commit

Permalink
bug for distributed training (open-mmlab#1985)
Browse files Browse the repository at this point in the history
fix a bug for distributed training in windows platform
  • Loading branch information
CapMocha authored and ioir123ju committed Mar 30, 2020
1 parent 1384463 commit 101a76d
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion mmdet/apis/train.py
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ def parse_losses(losses):
log_vars['loss'] = loss
for loss_name, loss_value in log_vars.items():
# reduce loss when distributed training
if dist.is_initialized():
if dist.is_available() and dist.is_initialized():
loss_value = loss_value.data.clone()
dist.all_reduce(loss_value.div_(dist.get_world_size()))
log_vars[loss_name] = loss_value.item()
Expand Down

0 comments on commit 101a76d

Please sign in to comment.