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
a12cec09
Commit
a12cec09
authored
Mar 11, 2020
by
Hongkun Yu
Committed by
A. Unique TensorFlower
Mar 11, 2020
Browse files
Internal change
PiperOrigin-RevId: 300477605
parent
e8afeaee
Changes
34
Hide whitespace changes
Inline
Side-by-side
Showing
20 changed files
with
7 additions
and
20 deletions
+7
-20
official/nlp/albert/export_albert_tfhub.py
official/nlp/albert/export_albert_tfhub.py
+0
-1
official/nlp/albert/export_albert_tfhub_test.py
official/nlp/albert/export_albert_tfhub_test.py
+0
-1
official/nlp/albert/run_classifier.py
official/nlp/albert/run_classifier.py
+0
-1
official/nlp/albert/run_squad.py
official/nlp/albert/run_squad.py
+0
-1
official/nlp/albert/tf2_albert_encoder_checkpoint_converter.py
...ial/nlp/albert/tf2_albert_encoder_checkpoint_converter.py
+0
-1
official/nlp/bert/export_tfhub.py
official/nlp/bert/export_tfhub.py
+0
-1
official/nlp/bert/export_tfhub_test.py
official/nlp/bert/export_tfhub_test.py
+0
-1
official/nlp/bert/run_classifier.py
official/nlp/bert/run_classifier.py
+0
-1
official/nlp/bert/run_pretraining.py
official/nlp/bert/run_pretraining.py
+0
-1
official/nlp/bert/run_squad.py
official/nlp/bert/run_squad.py
+0
-1
official/nlp/bert/tf2_encoder_checkpoint_converter.py
official/nlp/bert/tf2_encoder_checkpoint_converter.py
+1
-1
official/nlp/modeling/layers/transformer_test.py
official/nlp/modeling/layers/transformer_test.py
+0
-1
official/nlp/modeling/models/bert_classifier.py
official/nlp/modeling/models/bert_classifier.py
+1
-1
official/nlp/modeling/models/bert_classifier_test.py
official/nlp/modeling/models/bert_classifier_test.py
+1
-1
official/nlp/modeling/models/bert_pretrainer.py
official/nlp/modeling/models/bert_pretrainer.py
+1
-1
official/nlp/modeling/models/bert_pretrainer_test.py
official/nlp/modeling/models/bert_pretrainer_test.py
+1
-1
official/nlp/modeling/models/bert_span_labeler.py
official/nlp/modeling/models/bert_span_labeler.py
+1
-1
official/nlp/modeling/models/bert_span_labeler_test.py
official/nlp/modeling/models/bert_span_labeler_test.py
+1
-1
official/nlp/modeling/networks/albert_transformer_encoder_test.py
.../nlp/modeling/networks/albert_transformer_encoder_test.py
+0
-1
official/nlp/modeling/networks/encoder_scaffold_test.py
official/nlp/modeling/networks/encoder_scaffold_test.py
+0
-1
No files found.
official/nlp/albert/export_albert_tfhub.py
View file @
a12cec09
...
@@ -78,7 +78,6 @@ def export_albert_tfhub(albert_config: configs.AlbertConfig,
...
@@ -78,7 +78,6 @@ def export_albert_tfhub(albert_config: configs.AlbertConfig,
def
main
(
_
):
def
main
(
_
):
assert
tf
.
version
.
VERSION
.
startswith
(
'2.'
)
albert_config
=
configs
.
AlbertConfig
.
from_json_file
(
albert_config
=
configs
.
AlbertConfig
.
from_json_file
(
FLAGS
.
albert_config_file
)
FLAGS
.
albert_config_file
)
export_albert_tfhub
(
albert_config
,
FLAGS
.
model_checkpoint_path
,
export_albert_tfhub
(
albert_config
,
FLAGS
.
model_checkpoint_path
,
...
...
official/nlp/albert/export_albert_tfhub_test.py
View file @
a12cec09
...
@@ -86,5 +86,4 @@ class ExportAlbertTfhubTest(tf.test.TestCase):
...
@@ -86,5 +86,4 @@ class ExportAlbertTfhubTest(tf.test.TestCase):
if
__name__
==
"__main__"
:
if
__name__
==
"__main__"
:
assert
tf
.
version
.
VERSION
.
startswith
(
'2.'
)
tf
.
test
.
main
()
tf
.
test
.
main
()
official/nlp/albert/run_classifier.py
View file @
a12cec09
...
@@ -33,7 +33,6 @@ FLAGS = flags.FLAGS
...
@@ -33,7 +33,6 @@ FLAGS = flags.FLAGS
def
main
(
_
):
def
main
(
_
):
# Users should always run this script under TF 2.x
# Users should always run this script under TF 2.x
assert
tf
.
version
.
VERSION
.
startswith
(
'2.'
)
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/albert/run_squad.py
View file @
a12cec09
...
@@ -80,7 +80,6 @@ def export_squad(model_export_path, input_meta_data):
...
@@ -80,7 +80,6 @@ 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
assert
tf
.
version
.
VERSION
.
startswith
(
'2.'
)
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/albert/tf2_albert_encoder_checkpoint_converter.py
View file @
a12cec09
...
@@ -122,7 +122,6 @@ def convert_checkpoint(bert_config, output_path, v1_checkpoint):
...
@@ -122,7 +122,6 @@ def convert_checkpoint(bert_config, output_path, v1_checkpoint):
def
main
(
_
):
def
main
(
_
):
assert
tf
.
version
.
VERSION
.
startswith
(
'2.'
)
output_path
=
FLAGS
.
converted_checkpoint_path
output_path
=
FLAGS
.
converted_checkpoint_path
v1_checkpoint
=
FLAGS
.
checkpoint_to_convert
v1_checkpoint
=
FLAGS
.
checkpoint_to_convert
albert_config
=
configs
.
AlbertConfig
.
from_json_file
(
FLAGS
.
albert_config_file
)
albert_config
=
configs
.
AlbertConfig
.
from_json_file
(
FLAGS
.
albert_config_file
)
...
...
official/nlp/bert/export_tfhub.py
View file @
a12cec09
...
@@ -77,7 +77,6 @@ def export_bert_tfhub(bert_config: configs.BertConfig,
...
@@ -77,7 +77,6 @@ def export_bert_tfhub(bert_config: configs.BertConfig,
def
main
(
_
):
def
main
(
_
):
assert
tf
.
version
.
VERSION
.
startswith
(
'2.'
)
bert_config
=
configs
.
BertConfig
.
from_json_file
(
FLAGS
.
bert_config_file
)
bert_config
=
configs
.
BertConfig
.
from_json_file
(
FLAGS
.
bert_config_file
)
export_bert_tfhub
(
bert_config
,
FLAGS
.
model_checkpoint_path
,
FLAGS
.
export_path
,
export_bert_tfhub
(
bert_config
,
FLAGS
.
model_checkpoint_path
,
FLAGS
.
export_path
,
FLAGS
.
vocab_file
)
FLAGS
.
vocab_file
)
...
...
official/nlp/bert/export_tfhub_test.py
View file @
a12cec09
...
@@ -84,5 +84,4 @@ class ExportTfhubTest(tf.test.TestCase):
...
@@ -84,5 +84,4 @@ class ExportTfhubTest(tf.test.TestCase):
if
__name__
==
"__main__"
:
if
__name__
==
"__main__"
:
assert
tf
.
version
.
VERSION
.
startswith
(
'2.'
)
tf
.
test
.
main
()
tf
.
test
.
main
()
official/nlp/bert/run_classifier.py
View file @
a12cec09
...
@@ -403,7 +403,6 @@ def run_bert(strategy,
...
@@ -403,7 +403,6 @@ def run_bert(strategy,
def
main
(
_
):
def
main
(
_
):
# Users should always run this script under TF 2.x
# Users should always run this script under TF 2.x
assert
tf
.
version
.
VERSION
.
startswith
(
'2.'
)
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_pretraining.py
View file @
a12cec09
...
@@ -159,7 +159,6 @@ def run_bert_pretrain(strategy):
...
@@ -159,7 +159,6 @@ def run_bert_pretrain(strategy):
def
main
(
_
):
def
main
(
_
):
# Users should always run this script under TF 2.x
# Users should always run this script under TF 2.x
assert
tf
.
version
.
VERSION
.
startswith
(
'2.'
)
gin
.
parse_config_files_and_bindings
(
FLAGS
.
gin_file
,
FLAGS
.
gin_param
)
gin
.
parse_config_files_and_bindings
(
FLAGS
.
gin_file
,
FLAGS
.
gin_param
)
if
not
FLAGS
.
model_dir
:
if
not
FLAGS
.
model_dir
:
FLAGS
.
model_dir
=
'/tmp/bert20/'
FLAGS
.
model_dir
=
'/tmp/bert20/'
...
...
official/nlp/bert/run_squad.py
View file @
a12cec09
...
@@ -76,7 +76,6 @@ def export_squad(model_export_path, input_meta_data):
...
@@ -76,7 +76,6 @@ 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
assert
tf
.
version
.
VERSION
.
startswith
(
'2.'
)
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/tf2_encoder_checkpoint_converter.py
View file @
a12cec09
...
@@ -98,7 +98,7 @@ def convert_checkpoint(bert_config, output_path, v1_checkpoint):
...
@@ -98,7 +98,7 @@ def convert_checkpoint(bert_config, output_path, v1_checkpoint):
def
main
(
_
):
def
main
(
_
):
assert
tf
.
version
.
VERSION
.
startswith
(
'2.'
)
tf
.
enable_v2_behavior
(
)
output_path
=
FLAGS
.
converted_checkpoint_path
output_path
=
FLAGS
.
converted_checkpoint_path
v1_checkpoint
=
FLAGS
.
checkpoint_to_convert
v1_checkpoint
=
FLAGS
.
checkpoint_to_convert
bert_config
=
configs
.
BertConfig
.
from_json_file
(
FLAGS
.
bert_config_file
)
bert_config
=
configs
.
BertConfig
.
from_json_file
(
FLAGS
.
bert_config_file
)
...
...
official/nlp/modeling/layers/transformer_test.py
View file @
a12cec09
...
@@ -186,5 +186,4 @@ class TransformerLayerTest(keras_parameterized.TestCase):
...
@@ -186,5 +186,4 @@ class TransformerLayerTest(keras_parameterized.TestCase):
if
__name__
==
'__main__'
:
if
__name__
==
'__main__'
:
assert
tf
.
version
.
VERSION
.
startswith
(
'2.'
)
tf
.
test
.
main
()
tf
.
test
.
main
()
official/nlp/modeling/models/bert_classifier.py
View file @
a12cec09
...
@@ -19,7 +19,7 @@ from __future__ import division
...
@@ -19,7 +19,7 @@ from __future__ import division
# from __future__ import google_type_annotations
# from __future__ import google_type_annotations
from
__future__
import
print_function
from
__future__
import
print_function
import
tensorflow
as
tf
import
tensorflow
.compat.v2
as
tf
from
official.nlp.modeling
import
networks
from
official.nlp.modeling
import
networks
...
...
official/nlp/modeling/models/bert_classifier_test.py
View file @
a12cec09
...
@@ -18,7 +18,7 @@ from __future__ import absolute_import
...
@@ -18,7 +18,7 @@ from __future__ import absolute_import
from
__future__
import
division
from
__future__
import
division
from
__future__
import
print_function
from
__future__
import
print_function
import
tensorflow
as
tf
import
tensorflow
.compat.v2
as
tf
from
tensorflow.python.keras
import
keras_parameterized
# pylint: disable=g-direct-tensorflow-import
from
tensorflow.python.keras
import
keras_parameterized
# pylint: disable=g-direct-tensorflow-import
from
official.nlp.modeling
import
networks
from
official.nlp.modeling
import
networks
...
...
official/nlp/modeling/models/bert_pretrainer.py
View file @
a12cec09
...
@@ -20,7 +20,7 @@ from __future__ import division
...
@@ -20,7 +20,7 @@ from __future__ import division
from
__future__
import
print_function
from
__future__
import
print_function
import
copy
import
copy
import
tensorflow
as
tf
import
tensorflow
.compat.v2
as
tf
from
official.nlp.modeling
import
networks
from
official.nlp.modeling
import
networks
...
...
official/nlp/modeling/models/bert_pretrainer_test.py
View file @
a12cec09
...
@@ -18,7 +18,7 @@ from __future__ import absolute_import
...
@@ -18,7 +18,7 @@ from __future__ import absolute_import
from
__future__
import
division
from
__future__
import
division
from
__future__
import
print_function
from
__future__
import
print_function
import
tensorflow
as
tf
import
tensorflow
.compat.v2
as
tf
from
tensorflow.python.keras
import
keras_parameterized
# pylint: disable=g-direct-tensorflow-import
from
tensorflow.python.keras
import
keras_parameterized
# pylint: disable=g-direct-tensorflow-import
from
official.nlp.modeling
import
networks
from
official.nlp.modeling
import
networks
...
...
official/nlp/modeling/models/bert_span_labeler.py
View file @
a12cec09
...
@@ -19,7 +19,7 @@ from __future__ import division
...
@@ -19,7 +19,7 @@ from __future__ import division
# from __future__ import google_type_annotations
# from __future__ import google_type_annotations
from
__future__
import
print_function
from
__future__
import
print_function
import
tensorflow
as
tf
import
tensorflow
.compat.v2
as
tf
from
official.nlp.modeling
import
networks
from
official.nlp.modeling
import
networks
...
...
official/nlp/modeling/models/bert_span_labeler_test.py
View file @
a12cec09
...
@@ -18,7 +18,7 @@ from __future__ import absolute_import
...
@@ -18,7 +18,7 @@ from __future__ import absolute_import
from
__future__
import
division
from
__future__
import
division
from
__future__
import
print_function
from
__future__
import
print_function
import
tensorflow
as
tf
import
tensorflow
.compat.v2
as
tf
from
tensorflow.python.keras
import
keras_parameterized
# pylint: disable=g-direct-tensorflow-import
from
tensorflow.python.keras
import
keras_parameterized
# pylint: disable=g-direct-tensorflow-import
from
official.nlp.modeling
import
networks
from
official.nlp.modeling
import
networks
...
...
official/nlp/modeling/networks/albert_transformer_encoder_test.py
View file @
a12cec09
...
@@ -171,5 +171,4 @@ class AlbertTransformerEncoderTest(keras_parameterized.TestCase):
...
@@ -171,5 +171,4 @@ class AlbertTransformerEncoderTest(keras_parameterized.TestCase):
if
__name__
==
"__main__"
:
if
__name__
==
"__main__"
:
assert
tf
.
version
.
VERSION
.
startswith
(
'2.'
)
tf
.
test
.
main
()
tf
.
test
.
main
()
official/nlp/modeling/networks/encoder_scaffold_test.py
View file @
a12cec09
...
@@ -626,5 +626,4 @@ class EncoderScaffoldHiddenInstanceTest(keras_parameterized.TestCase):
...
@@ -626,5 +626,4 @@ class EncoderScaffoldHiddenInstanceTest(keras_parameterized.TestCase):
if
__name__
==
"__main__"
:
if
__name__
==
"__main__"
:
assert
tf
.
version
.
VERSION
.
startswith
(
'2.'
)
tf
.
test
.
main
()
tf
.
test
.
main
()
Prev
1
2
Next
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