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
17155b49
Commit
17155b49
authored
Oct 21, 2020
by
Chen Chen
Committed by
A. Unique TensorFlower
Oct 21, 2020
Browse files
Avoid loading hub model twice
PiperOrigin-RevId: 338249187
parent
7cffe103
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
2 additions
and
2 deletions
+2
-2
official/nlp/tasks/utils.py
official/nlp/tasks/utils.py
+2
-2
No files found.
official/nlp/tasks/utils.py
View file @
17155b49
...
...
@@ -49,8 +49,8 @@ def get_encoder_from_hub(hub_model_path: str) -> tf.keras.Model:
# as input and returns a dict.
# TODO(chendouble): Remove the support of legacy hub model when the new ones
# are released.
hub_
model
=
hub
.
load
(
hub_model_path
)
hub_output_signature
=
hub_model
.
signatures
[
'serving_default'
].
outputs
hub_
output_signature
=
hub_layer
.
resolved_object
.
signatures
[
'serving_default'
].
outputs
if
len
(
hub_output_signature
)
==
2
:
logging
.
info
(
'Use the legacy hub module with list as input/output.'
)
pooled_output
,
sequence_output
=
hub_layer
(
...
...
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