BaseTrainer with find_unused_parameters=True when using DistributedDataParallel() (#14323)
This commit is contained in:
parent
997f2c92cd
commit
470b120a1b
1 changed files with 1 additions and 1 deletions
|
|
@ -266,7 +266,7 @@ class BaseTrainer:
|
||||||
self.amp = bool(self.amp) # as boolean
|
self.amp = bool(self.amp) # as boolean
|
||||||
self.scaler = torch.cuda.amp.GradScaler(enabled=self.amp)
|
self.scaler = torch.cuda.amp.GradScaler(enabled=self.amp)
|
||||||
if world_size > 1:
|
if world_size > 1:
|
||||||
self.model = nn.parallel.DistributedDataParallel(self.model, device_ids=[RANK])
|
self.model = nn.parallel.DistributedDataParallel(self.model, device_ids=[RANK], find_unused_parameters=True)
|
||||||
|
|
||||||
# Check imgsz
|
# Check imgsz
|
||||||
gs = max(int(self.model.stride.max() if hasattr(self.model, "stride") else 32), 32) # grid size (max stride)
|
gs = max(int(self.model.stride.max() if hasattr(self.model, "stride") else 32), 32) # grid size (max stride)
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue