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

Commit a83a67a

Browse files
abhinavnmagicbfineran
authored andcommitted
removing checkpointing recipe if its None (#1308)
1 parent 4b655d5 commit a83a67a

File tree

1 file changed

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

1 file changed

+3
-2
lines changed

src/sparseml/pytorch/torchvision/train.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -467,7 +467,7 @@ def collate_fn(batch):
467467
)
468468
checkpoint_manager = (
469469
ScheduledModifierManager.from_yaml(checkpoint["recipe"])
470-
if "recipe" in checkpoint
470+
if "recipe" in checkpoint and checkpoint["recipe"] is not None
471471
else None
472472
)
473473
elif args.resume:
@@ -635,7 +635,8 @@ def log_metrics(tag: str, metrics: utils.MetricLogger, epoch: int, epoch_step: i
635635
)
636636
else:
637637
checkpoint["epoch"] = -1 if epoch == max_epochs - 1 else epoch
638-
checkpoint["recipe"] = str(manager)
638+
if str(manager) is not None:
639+
checkpoint["recipe"] = str(manager)
639640

640641
file_names = ["checkpoint.pth"]
641642
if is_new_best:

0 commit comments

Comments
 (0)