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
Uni-Core
Commits
70dcdf17
Commit
70dcdf17
authored
Sep 05, 2022
by
Guolin Ke
Browse files
bug fix for rngstate with update_freq > 1.
parent
0a79672a
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
5 deletions
+8
-5
unicore/trainer.py
unicore/trainer.py
+8
-5
No files found.
unicore/trainer.py
View file @
70dcdf17
...
...
@@ -399,13 +399,13 @@ class Trainer(object):
if
errors
.
missing_keys
:
logger
.
warning
(
"Error in loading model state, missing_keys "
+
str
(
errors
.
missing_keys
)
"Error in loading model state, missing_keys "
+
str
(
errors
.
missing_keys
)
)
if
errors
.
unexpected_keys
:
logger
.
warning
(
"Error in loading model state, unexpected_keys "
+
str
(
errors
.
unexpected_keys
)
"Error in loading model state, unexpected_keys "
+
str
(
errors
.
unexpected_keys
)
)
if
utils
.
has_parameters
(
self
.
get_loss
()):
self
.
get_loss
().
load_state_dict
(
state
[
"loss"
],
strict
=
True
)
...
...
@@ -607,7 +607,10 @@ class Trainer(object):
with
maybe_no_sync
():
# use different seed for different rank in training, otherwise the dropout will be the same in different workers.
with
utils
.
torch_seed
(
self
.
args
.
seed
,
self
.
get_num_updates
(),
self
.
data_parallel_rank
self
.
args
.
seed
,
self
.
get_num_updates
(),
i
,
self
.
data_parallel_rank
,
):
# forward and backward
loss
,
sample_size_i
,
logging_output
=
self
.
task
.
train_step
(
...
...
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