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
04165099
Commit
04165099
authored
Apr 21, 2020
by
Le Hou
Committed by
A. Unique TensorFlower
Apr 21, 2020
Browse files
Internal change
PiperOrigin-RevId: 307712303
parent
330b34fe
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
5 additions
and
0 deletions
+5
-0
official/nlp/bert/run_classifier.py
official/nlp/bert/run_classifier.py
+3
-0
official/nlp/bert/run_squad.py
official/nlp/bert/run_squad.py
+2
-0
No files found.
official/nlp/bert/run_classifier.py
View file @
04165099
...
@@ -24,6 +24,7 @@ import os
...
@@ -24,6 +24,7 @@ import os
from
absl
import
app
from
absl
import
app
from
absl
import
flags
from
absl
import
flags
from
absl
import
logging
from
absl
import
logging
import
gin
import
tensorflow
as
tf
import
tensorflow
as
tf
from
official.modeling
import
performance
from
official.modeling
import
performance
from
official.nlp
import
optimization
from
official.nlp
import
optimization
...
@@ -404,6 +405,8 @@ def custom_main(custom_callbacks=None):
...
@@ -404,6 +405,8 @@ def custom_main(custom_callbacks=None):
Args:
Args:
custom_callbacks: list of tf.keras.Callbacks passed to training loop.
custom_callbacks: list of tf.keras.Callbacks passed to training loop.
"""
"""
gin
.
parse_config_files_and_bindings
(
FLAGS
.
gin_file
,
FLAGS
.
gin_param
)
with
tf
.
io
.
gfile
.
GFile
(
FLAGS
.
input_meta_data_path
,
'rb'
)
as
reader
:
with
tf
.
io
.
gfile
.
GFile
(
FLAGS
.
input_meta_data_path
,
'rb'
)
as
reader
:
input_meta_data
=
json
.
loads
(
reader
.
read
().
decode
(
'utf-8'
))
input_meta_data
=
json
.
loads
(
reader
.
read
().
decode
(
'utf-8'
))
...
...
official/nlp/bert/run_squad.py
View file @
04165099
...
@@ -25,6 +25,7 @@ import time
...
@@ -25,6 +25,7 @@ import time
from
absl
import
app
from
absl
import
app
from
absl
import
flags
from
absl
import
flags
from
absl
import
logging
from
absl
import
logging
import
gin
import
tensorflow
as
tf
import
tensorflow
as
tf
from
official.nlp.bert
import
configs
as
bert_configs
from
official.nlp.bert
import
configs
as
bert_configs
...
@@ -91,6 +92,7 @@ def export_squad(model_export_path, input_meta_data):
...
@@ -91,6 +92,7 @@ def export_squad(model_export_path, input_meta_data):
def
main
(
_
):
def
main
(
_
):
# Users should always run this script under TF 2.x
# Users should always run this script under TF 2.x
gin
.
parse_config_files_and_bindings
(
FLAGS
.
gin_file
,
FLAGS
.
gin_param
)
with
tf
.
io
.
gfile
.
GFile
(
FLAGS
.
input_meta_data_path
,
'rb'
)
as
reader
:
with
tf
.
io
.
gfile
.
GFile
(
FLAGS
.
input_meta_data_path
,
'rb'
)
as
reader
:
input_meta_data
=
json
.
loads
(
reader
.
read
().
decode
(
'utf-8'
))
input_meta_data
=
json
.
loads
(
reader
.
read
().
decode
(
'utf-8'
))
...
...
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