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

Commit cf441a7

Browse files
authored
Fix incorrect epoch in the checkpoint (#159)
The checkpoint created at the end of training is saved with the wrong epoch number because of the `epoch += 1` in the training loop.
1 parent 91025d2 commit cf441a7

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

scripts/pytorch_vision.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1193,7 +1193,7 @@ def train(args, model, train_loader, val_loader, input_shape, save_dir, loggers)
11931193
# only convert qat -> quantized ONNX graph for finalized model
11941194
# TODO: change this to all checkpoints when conversion times improve
11951195
_save_model_training(
1196-
model, optim, input_shape, "model", save_dir, epoch, val_res, True
1196+
model, optim, input_shape, "model", save_dir, epoch - 1, val_res, True
11971197
)
11981198

11991199
LOGGER.info("layer sparsities:")

0 commit comments

Comments
 (0)