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

Commit e959958

Browse files
abhinavnmagicbfineran
authored andcommitted
Ignore optimizer on testing (#1325)
1 parent 0f03dff commit e959958

File tree

1 file changed

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

1 file changed

+1
-1
lines changed

src/sparseml/pytorch/torchvision/train.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -508,7 +508,7 @@ def collate_fn(batch):
508508

509509
# load params
510510
if checkpoint is not None:
511-
if "optimizer" in checkpoint:
511+
if "optimizer" in checkpoint and not args.test_only:
512512
optimizer.load_state_dict(checkpoint["optimizer"])
513513
if model_ema and "model_ema" in checkpoint:
514514
model_ema.load_state_dict(checkpoint["model_ema"])

0 commit comments

Comments
 (0)