Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
OpenDAS
Fairseq
Commits
fe54ea54
Commit
fe54ea54
authored
Apr 08, 2018
by
alexeib
Committed by
Myle Ott
Jun 15, 2018
Browse files
fix optim history
parent
b84070b7
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
2 additions
and
1 deletion
+2
-1
fairseq/trainer.py
fairseq/trainer.py
+2
-1
No files found.
fairseq/trainer.py
View file @
fe54ea54
...
@@ -61,8 +61,9 @@ class Trainer(object):
...
@@ -61,8 +61,9 @@ class Trainer(object):
def
save_checkpoint
(
self
,
filename
,
extra_state
):
def
save_checkpoint
(
self
,
filename
,
extra_state
):
"""Save all training state in a checkpoint file."""
"""Save all training state in a checkpoint file."""
if
distributed_utils
.
is_master
(
self
.
args
):
# only save one checkpoint
if
distributed_utils
.
is_master
(
self
.
args
):
# only save one checkpoint
optim_history
=
self
.
_optim_history
if
hasattr
(
self
,
'_optim_history'
)
else
None
utils
.
save_state
(
filename
,
self
.
args
,
self
.
model
,
self
.
criterion
,
self
.
optimizer
,
utils
.
save_state
(
filename
,
self
.
args
,
self
.
model
,
self
.
criterion
,
self
.
optimizer
,
self
.
lr_scheduler
,
self
.
_num_updates
,
self
.
_
optim_history
,
extra_state
)
self
.
lr_scheduler
,
self
.
_num_updates
,
optim_history
,
extra_state
)
def
load_checkpoint
(
self
,
filename
):
def
load_checkpoint
(
self
,
filename
):
"""Load all training state from a checkpoint file."""
"""Load all training state from a checkpoint file."""
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment