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
ModelZoo
ResNet50_tensorflow
Commits
690e44ed
Commit
690e44ed
authored
Dec 14, 2020
by
Chen Chen
Committed by
A. Unique TensorFlower
Dec 14, 2020
Browse files
Internal change
PiperOrigin-RevId: 347505505
parent
1ee1969c
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
4 additions
and
4 deletions
+4
-4
official/nlp/bert/model_training_utils.py
official/nlp/bert/model_training_utils.py
+2
-2
official/nlp/bert/run_classifier.py
official/nlp/bert/run_classifier.py
+2
-2
No files found.
official/nlp/bert/model_training_utils.py
View file @
690e44ed
...
...
@@ -283,8 +283,8 @@ def run_customized_training_loop(
logging
.
info
(
'Checkpoint file %s found and restoring from '
'initial checkpoint for core model.'
,
init_checkpoint
)
checkpoint
=
tf
.
train
.
Checkpoint
(
model
=
sub_model
)
checkpoint
.
re
store
(
init_checkpoint
).
assert_existing_objects_matched
()
checkpoint
=
tf
.
train
.
Checkpoint
(
model
=
sub_model
,
encoder
=
sub_model
)
checkpoint
.
re
ad
(
init_checkpoint
).
assert_existing_objects_matched
()
logging
.
info
(
'Loading from checkpoint file completed'
)
train_loss_metric
=
tf
.
keras
.
metrics
.
Mean
(
'training_loss'
,
dtype
=
tf
.
float32
)
...
...
official/nlp/bert/run_classifier.py
View file @
690e44ed
...
...
@@ -220,8 +220,8 @@ def run_keras_compile_fit(model_dir,
optimizer
=
bert_model
.
optimizer
if
init_checkpoint
:
checkpoint
=
tf
.
train
.
Checkpoint
(
model
=
sub_model
)
checkpoint
.
re
store
(
init_checkpoint
).
assert_existing_objects_matched
()
checkpoint
=
tf
.
train
.
Checkpoint
(
model
=
sub_model
,
encoder
=
sub_model
)
checkpoint
.
re
ad
(
init_checkpoint
).
assert_existing_objects_matched
()
if
not
isinstance
(
metric_fn
,
(
list
,
tuple
)):
metric_fn
=
[
metric_fn
]
...
...
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