Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix crash when loading old checkpoints with -reset_iterations 0 flag #88

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

ChrisCummins
Copy link
Collaborator

Using -reset_iterations 0 when initialising training from a checkpoint made before commit 6990602 causes an error, as reported in issue #82. This patch adds a backwards compatibility fix.

For checkpoint files which do not contain the iteration counter, a warning is printed on checkpoint load and training continues as if not flag was given:

$ th train.lua $OPTIONS -init_from cv/checkpoint_10.t7 -reset_iterations 0
Running in CPU mode
Initializing from   cv/checkpoint_10.t7
reset_iterations: cv/checkpoint_10.t7 contains no iteration counter
Epoch 1.00 / 50, i = 1 / 17800, loss = 3.474951
Epoch 1.01 / 50, i = 2 / 17800, loss = 3.344084
...

The behaviour for checkpoints which do contain an iteration counter is unaffected.

Using `-reset_iterations 0` when initialising training from a checkpoint
made before commit 6990602 causes an
error, as reported in issue jcjohnson#82. This patch adds a backwards
compatibility fix.

For checkpoint files which do not contain the iteration counter, a
warning is printed on checkpoint load and training continues as if not
flag was given:

    $ th train.lua $OPTIONS -init_from cv/checkpoint_10.t7 -reset_iterations 0
    Running in CPU mode
    Initializing from 	cv/checkpoint_10.t7
    reset_iterations: cv/checkpoint_10.t7 contains no iteration counter
    Epoch 1.00 / 50, i = 1 / 17800, loss = 3.474951
    Epoch 1.01 / 50, i = 2 / 17800, loss = 3.344084
    ...

The behaviour for checkpoints which do contain an iteration counter is
unaffected.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant