Skip to content
This repository has been archived by the owner on May 1, 2023. It is now read-only.

(BREAKING) save_checkpoint(): Save dict of user values instead of best_top1 #219

Merged
merged 5 commits into from
Apr 11, 2019

Conversation

guyjacob
Copy link
Contributor

@guyjacob guyjacob commented Apr 4, 2019

'best_top1' is too specific to classification workloads. Suggesting to just pass a dictionary of values instead, which will allow to pass anything the user deems worthy.
Also modified load_checkpoint to print a summary of the checkpoint contents, it looks something like this:

=> loading checkpoint logs/2019.04.04-131231/checkpoint.pth.tar
=> Checkpoint contents:
+----------------------+----------------+
| Key                  | Type / Value   |
|----------------------+----------------|
| arch                 | resnet20_cifar |
| best_epoch           | 1              |
| best_top1            | 58.06          |
| compression_sched    | dict           |
| current_top1         | 53.18          |
| epoch                | 2              |
| optimizer_state_dict | dict           |
| optimizer_type       | SGD            |
| state_dict           | OrderedDict    |
+----------------------+----------------+

For "simple" values it'll print the actual value, otherwise it prints the type.

@guyjacob guyjacob requested a review from nzmora April 4, 2019 12:08
@guyjacob
Copy link
Contributor Author

guyjacob commented Apr 4, 2019

@barrh please take a look, can't add you as a reviewer for some reason

Copy link
Contributor

@barrh barrh left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'd love to see if you could also return the extra values from load_checkpoint.
The request for changes is for the inline comment.

distiller/apputils/checkpoint.py Outdated Show resolved Hide resolved
@guyjacob guyjacob changed the title (BREAKING) save_checkpoint(): Replace 'best_top1 ' with dict of values (BREAKING) save_checkpoint(): Save dict of user values instead of best_top1 Apr 11, 2019
@guyjacob guyjacob merged commit 158602c into master Apr 11, 2019
@guyjacob guyjacob deleted the chkpt_save_vals branch April 11, 2019 13:35
michaelbeale-IL pushed a commit that referenced this pull request Apr 24, 2023
* Replace the optional 'best_top1' parameter with a generic
  optional dict which the caller can populate as needed.
* Saved in the checkpoint under the key 'extras'
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants