Skip to content
This repository was archived by the owner on Jun 3, 2025. It is now read-only.

Commit 0f03dff

Browse files
natuanbfineran
authored andcommitted
Fix scaler bug (#1323)
1 parent 0031883 commit 0f03dff

File tree

1 file changed

+2
-1
lines changed
  • src/sparseml/pytorch/torchvision

1 file changed

+2
-1
lines changed

src/sparseml/pytorch/torchvision/train.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -605,7 +605,8 @@ def log_metrics(tag: str, metrics: utils.MetricLogger, epoch: int, epoch_step: i
605605
if args.distributed:
606606
train_sampler.set_epoch(epoch)
607607
if manager is not None and manager.qat_active(epoch=epoch):
608-
scaler._enabled = False
608+
if scaler is not None:
609+
scaler._enabled = False
609610
model_ema = None
610611

611612
train_metrics = train_one_epoch(

0 commit comments

Comments
 (0)