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
d7511194
Unverified
Commit
d7511194
authored
Jan 22, 2022
by
Srihari Humbarwadi
Committed by
GitHub
Jan 22, 2022
Browse files
Merge branch 'tensorflow:master' into panoptic-deeplab-modeling
parents
2ad1ec15
ab8b8012
Changes
1000
Hide whitespace changes
Inline
Side-by-side
Showing
20 changed files
with
35 additions
and
36 deletions
+35
-36
official/nlp/tools/tf1_bert_checkpoint_converter_lib.py
official/nlp/tools/tf1_bert_checkpoint_converter_lib.py
+1
-1
official/nlp/tools/tf2_albert_encoder_checkpoint_converter.py
...cial/nlp/tools/tf2_albert_encoder_checkpoint_converter.py
+6
-7
official/nlp/tools/tf2_bert_encoder_checkpoint_converter.py
official/nlp/tools/tf2_bert_encoder_checkpoint_converter.py
+9
-9
official/nlp/tools/tokenization.py
official/nlp/tools/tokenization.py
+1
-1
official/nlp/tools/tokenization_test.py
official/nlp/tools/tokenization_test.py
+2
-2
official/nlp/train.py
official/nlp/train.py
+1
-1
official/nlp/xlnet/__init__.py
official/nlp/xlnet/__init__.py
+1
-1
official/nlp/xlnet/classifier_utils.py
official/nlp/xlnet/classifier_utils.py
+1
-1
official/nlp/xlnet/common_flags.py
official/nlp/xlnet/common_flags.py
+1
-1
official/nlp/xlnet/data_utils.py
official/nlp/xlnet/data_utils.py
+1
-1
official/nlp/xlnet/optimization.py
official/nlp/xlnet/optimization.py
+1
-1
official/nlp/xlnet/preprocess_classification_data.py
official/nlp/xlnet/preprocess_classification_data.py
+1
-1
official/nlp/xlnet/preprocess_pretrain_data.py
official/nlp/xlnet/preprocess_pretrain_data.py
+1
-1
official/nlp/xlnet/preprocess_squad_data.py
official/nlp/xlnet/preprocess_squad_data.py
+1
-1
official/nlp/xlnet/preprocess_utils.py
official/nlp/xlnet/preprocess_utils.py
+1
-1
official/nlp/xlnet/run_classifier.py
official/nlp/xlnet/run_classifier.py
+1
-1
official/nlp/xlnet/run_pretrain.py
official/nlp/xlnet/run_pretrain.py
+1
-1
official/nlp/xlnet/run_squad.py
official/nlp/xlnet/run_squad.py
+1
-1
official/nlp/xlnet/squad_utils.py
official/nlp/xlnet/squad_utils.py
+1
-1
official/nlp/xlnet/training_utils.py
official/nlp/xlnet/training_utils.py
+2
-2
No files found.
Too many changes to show.
To preserve performance only
1000 of 1000+
files are displayed.
Plain diff
Email patch
official/nlp/bert
/tf1
_checkpoint_converter_lib.py
→
official/nlp/
tools/tf1_
bert_checkpoint_converter_lib.py
View file @
d7511194
# Copyright 202
1
The TensorFlow Authors. All Rights Reserved.
# Copyright 202
2
The TensorFlow Authors. All Rights Reserved.
#
#
# Licensed under the Apache License, Version 2.0 (the "License");
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# you may not use this file except in compliance with the License.
...
...
official/nlp/tools/tf2_albert_encoder_checkpoint_converter.py
View file @
d7511194
# Copyright 202
1
The TensorFlow Authors. All Rights Reserved.
# Copyright 202
2
The TensorFlow Authors. All Rights Reserved.
#
#
# Licensed under the Apache License, Version 2.0 (the "License");
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# you may not use this file except in compliance with the License.
...
@@ -25,9 +25,9 @@ from absl import flags
...
@@ -25,9 +25,9 @@ from absl import flags
import
tensorflow
as
tf
import
tensorflow
as
tf
from
official.legacy.albert
import
configs
from
official.legacy.albert
import
configs
from
official.modeling
import
tf_utils
from
official.modeling
import
tf_utils
from
official.nlp.bert
import
tf1_checkpoint_converter_lib
from
official.nlp.modeling
import
models
from
official.nlp.modeling
import
models
from
official.nlp.modeling
import
networks
from
official.nlp.modeling
import
networks
from
official.nlp.tools
import
tf1_bert_checkpoint_converter_lib
FLAGS
=
flags
.
FLAGS
FLAGS
=
flags
.
FLAGS
...
@@ -128,12 +128,12 @@ def convert_checkpoint(bert_config, output_path, v1_checkpoint,
...
@@ -128,12 +128,12 @@ def convert_checkpoint(bert_config, output_path, v1_checkpoint,
# Create a temporary V1 name-converted checkpoint in the output directory.
# Create a temporary V1 name-converted checkpoint in the output directory.
temporary_checkpoint_dir
=
os
.
path
.
join
(
output_dir
,
"temp_v1"
)
temporary_checkpoint_dir
=
os
.
path
.
join
(
output_dir
,
"temp_v1"
)
temporary_checkpoint
=
os
.
path
.
join
(
temporary_checkpoint_dir
,
"ckpt"
)
temporary_checkpoint
=
os
.
path
.
join
(
temporary_checkpoint_dir
,
"ckpt"
)
tf1_checkpoint_converter_lib
.
convert
(
tf1_
bert_
checkpoint_converter_lib
.
convert
(
checkpoint_from_path
=
v1_checkpoint
,
checkpoint_from_path
=
v1_checkpoint
,
checkpoint_to_path
=
temporary_checkpoint
,
checkpoint_to_path
=
temporary_checkpoint
,
num_heads
=
bert_config
.
num_attention_heads
,
num_heads
=
bert_config
.
num_attention_heads
,
name_replacements
=
ALBERT_NAME_REPLACEMENTS
,
name_replacements
=
ALBERT_NAME_REPLACEMENTS
,
permutations
=
tf1_checkpoint_converter_lib
.
BERT_V2_PERMUTATIONS
,
permutations
=
tf1_
bert_
checkpoint_converter_lib
.
BERT_V2_PERMUTATIONS
,
exclude_patterns
=
[
"adam"
,
"Adam"
])
exclude_patterns
=
[
"adam"
,
"Adam"
])
# Create a V2 checkpoint from the temporary checkpoint.
# Create a V2 checkpoint from the temporary checkpoint.
...
@@ -144,9 +144,8 @@ def convert_checkpoint(bert_config, output_path, v1_checkpoint,
...
@@ -144,9 +144,8 @@ def convert_checkpoint(bert_config, output_path, v1_checkpoint,
else
:
else
:
raise
ValueError
(
"Unsupported converted_model: %s"
%
converted_model
)
raise
ValueError
(
"Unsupported converted_model: %s"
%
converted_model
)
tf1_checkpoint_converter_lib
.
create_v2_checkpoint
(
model
,
temporary_checkpoint
,
tf1_bert_checkpoint_converter_lib
.
create_v2_checkpoint
(
output_path
,
model
,
temporary_checkpoint
,
output_path
,
checkpoint_model_name
)
checkpoint_model_name
)
# Clean up the temporary checkpoint, if it exists.
# Clean up the temporary checkpoint, if it exists.
try
:
try
:
...
...
official/nlp/bert
/tf2
_encoder_checkpoint_converter.py
→
official/nlp/
tools/tf2_
bert_encoder_checkpoint_converter.py
View file @
d7511194
# Copyright 202
1
The TensorFlow Authors. All Rights Reserved.
# Copyright 202
2
The TensorFlow Authors. All Rights Reserved.
#
#
# Licensed under the Apache License, Version 2.0 (the "License");
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# you may not use this file except in compliance with the License.
...
@@ -25,11 +25,11 @@ from absl import app
...
@@ -25,11 +25,11 @@ from absl import app
from
absl
import
flags
from
absl
import
flags
import
tensorflow
as
tf
import
tensorflow
as
tf
from
official.legacy.bert
import
configs
from
official.modeling
import
tf_utils
from
official.modeling
import
tf_utils
from
official.nlp.bert
import
configs
from
official.nlp.bert
import
tf1_checkpoint_converter_lib
from
official.nlp.modeling
import
models
from
official.nlp.modeling
import
models
from
official.nlp.modeling
import
networks
from
official.nlp.modeling
import
networks
from
official.nlp.tools
import
tf1_bert_checkpoint_converter_lib
FLAGS
=
flags
.
FLAGS
FLAGS
=
flags
.
FLAGS
...
@@ -111,12 +111,13 @@ def convert_checkpoint(bert_config,
...
@@ -111,12 +111,13 @@ def convert_checkpoint(bert_config,
temporary_checkpoint_dir
=
os
.
path
.
join
(
output_dir
,
"temp_v1"
)
temporary_checkpoint_dir
=
os
.
path
.
join
(
output_dir
,
"temp_v1"
)
temporary_checkpoint
=
os
.
path
.
join
(
temporary_checkpoint_dir
,
"ckpt"
)
temporary_checkpoint
=
os
.
path
.
join
(
temporary_checkpoint_dir
,
"ckpt"
)
tf1_checkpoint_converter_lib
.
convert
(
tf1_
bert_
checkpoint_converter_lib
.
convert
(
checkpoint_from_path
=
v1_checkpoint
,
checkpoint_from_path
=
v1_checkpoint
,
checkpoint_to_path
=
temporary_checkpoint
,
checkpoint_to_path
=
temporary_checkpoint
,
num_heads
=
bert_config
.
num_attention_heads
,
num_heads
=
bert_config
.
num_attention_heads
,
name_replacements
=
tf1_checkpoint_converter_lib
.
BERT_V2_NAME_REPLACEMENTS
,
name_replacements
=
(
permutations
=
tf1_checkpoint_converter_lib
.
BERT_V2_PERMUTATIONS
,
tf1_bert_checkpoint_converter_lib
.
BERT_V2_NAME_REPLACEMENTS
),
permutations
=
tf1_bert_checkpoint_converter_lib
.
BERT_V2_PERMUTATIONS
,
exclude_patterns
=
[
"adam"
,
"Adam"
])
exclude_patterns
=
[
"adam"
,
"Adam"
])
if
converted_model
==
"encoder"
:
if
converted_model
==
"encoder"
:
...
@@ -127,9 +128,8 @@ def convert_checkpoint(bert_config,
...
@@ -127,9 +128,8 @@ def convert_checkpoint(bert_config,
raise
ValueError
(
"Unsupported converted_model: %s"
%
converted_model
)
raise
ValueError
(
"Unsupported converted_model: %s"
%
converted_model
)
# Create a V2 checkpoint from the temporary checkpoint.
# Create a V2 checkpoint from the temporary checkpoint.
tf1_checkpoint_converter_lib
.
create_v2_checkpoint
(
model
,
temporary_checkpoint
,
tf1_bert_checkpoint_converter_lib
.
create_v2_checkpoint
(
output_path
,
model
,
temporary_checkpoint
,
output_path
,
checkpoint_model_name
)
checkpoint_model_name
)
# Clean up the temporary checkpoint, if it exists.
# Clean up the temporary checkpoint, if it exists.
try
:
try
:
...
...
official/nlp/
bert
/tokenization.py
→
official/nlp/
tools
/tokenization.py
View file @
d7511194
# Copyright 202
1
The TensorFlow Authors. All Rights Reserved.
# Copyright 202
2
The TensorFlow Authors. All Rights Reserved.
#
#
# Licensed under the Apache License, Version 2.0 (the "License");
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# you may not use this file except in compliance with the License.
...
...
official/nlp/
bert
/tokenization_test.py
→
official/nlp/
tools
/tokenization_test.py
View file @
d7511194
# Copyright 202
1
The TensorFlow Authors. All Rights Reserved.
# Copyright 202
2
The TensorFlow Authors. All Rights Reserved.
#
#
# Licensed under the Apache License, Version 2.0 (the "License");
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# you may not use this file except in compliance with the License.
...
@@ -18,7 +18,7 @@ import tempfile
...
@@ -18,7 +18,7 @@ import tempfile
import
six
import
six
import
tensorflow
as
tf
import
tensorflow
as
tf
from
official.nlp.
bert
import
tokenization
from
official.nlp.
tools
import
tokenization
class
TokenizationTest
(
tf
.
test
.
TestCase
):
class
TokenizationTest
(
tf
.
test
.
TestCase
):
...
...
official/nlp/train.py
View file @
d7511194
# Copyright 202
1
The TensorFlow Authors. All Rights Reserved.
# Copyright 202
2
The TensorFlow Authors. All Rights Reserved.
#
#
# Licensed under the Apache License, Version 2.0 (the "License");
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# you may not use this file except in compliance with the License.
...
...
official/nlp/xlnet/__init__.py
View file @
d7511194
# Copyright 202
1
The TensorFlow Authors. All Rights Reserved.
# Copyright 202
2
The TensorFlow Authors. All Rights Reserved.
#
#
# Licensed under the Apache License, Version 2.0 (the "License");
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# you may not use this file except in compliance with the License.
...
...
official/nlp/xlnet/classifier_utils.py
View file @
d7511194
# Copyright 202
1
The TensorFlow Authors. All Rights Reserved.
# Copyright 202
2
The TensorFlow Authors. All Rights Reserved.
#
#
# Licensed under the Apache License, Version 2.0 (the "License");
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# you may not use this file except in compliance with the License.
...
...
official/nlp/xlnet/common_flags.py
View file @
d7511194
# Copyright 202
1
The TensorFlow Authors. All Rights Reserved.
# Copyright 202
2
The TensorFlow Authors. All Rights Reserved.
#
#
# Licensed under the Apache License, Version 2.0 (the "License");
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# you may not use this file except in compliance with the License.
...
...
official/nlp/xlnet/data_utils.py
View file @
d7511194
# Copyright 202
1
The TensorFlow Authors. All Rights Reserved.
# Copyright 202
2
The TensorFlow Authors. All Rights Reserved.
#
#
# Licensed under the Apache License, Version 2.0 (the "License");
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# you may not use this file except in compliance with the License.
...
...
official/nlp/xlnet/optimization.py
View file @
d7511194
# Copyright 202
1
The TensorFlow Authors. All Rights Reserved.
# Copyright 202
2
The TensorFlow Authors. All Rights Reserved.
#
#
# Licensed under the Apache License, Version 2.0 (the "License");
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# you may not use this file except in compliance with the License.
...
...
official/nlp/xlnet/preprocess_classification_data.py
View file @
d7511194
# Copyright 202
1
The TensorFlow Authors. All Rights Reserved.
# Copyright 202
2
The TensorFlow Authors. All Rights Reserved.
#
#
# Licensed under the Apache License, Version 2.0 (the "License");
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# you may not use this file except in compliance with the License.
...
...
official/nlp/xlnet/preprocess_pretrain_data.py
View file @
d7511194
# Copyright 202
1
The TensorFlow Authors. All Rights Reserved.
# Copyright 202
2
The TensorFlow Authors. All Rights Reserved.
#
#
# Licensed under the Apache License, Version 2.0 (the "License");
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# you may not use this file except in compliance with the License.
...
...
official/nlp/xlnet/preprocess_squad_data.py
View file @
d7511194
# Copyright 202
1
The TensorFlow Authors. All Rights Reserved.
# Copyright 202
2
The TensorFlow Authors. All Rights Reserved.
#
#
# Licensed under the Apache License, Version 2.0 (the "License");
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# you may not use this file except in compliance with the License.
...
...
official/nlp/xlnet/preprocess_utils.py
View file @
d7511194
# Copyright 202
1
The TensorFlow Authors. All Rights Reserved.
# Copyright 202
2
The TensorFlow Authors. All Rights Reserved.
#
#
# Licensed under the Apache License, Version 2.0 (the "License");
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# you may not use this file except in compliance with the License.
...
...
official/nlp/xlnet/run_classifier.py
View file @
d7511194
# Copyright 202
1
The TensorFlow Authors. All Rights Reserved.
# Copyright 202
2
The TensorFlow Authors. All Rights Reserved.
#
#
# Licensed under the Apache License, Version 2.0 (the "License");
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# you may not use this file except in compliance with the License.
...
...
official/nlp/xlnet/run_pretrain.py
View file @
d7511194
# Copyright 202
1
The TensorFlow Authors. All Rights Reserved.
# Copyright 202
2
The TensorFlow Authors. All Rights Reserved.
#
#
# Licensed under the Apache License, Version 2.0 (the "License");
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# you may not use this file except in compliance with the License.
...
...
official/nlp/xlnet/run_squad.py
View file @
d7511194
# Copyright 202
1
The TensorFlow Authors. All Rights Reserved.
# Copyright 202
2
The TensorFlow Authors. All Rights Reserved.
#
#
# Licensed under the Apache License, Version 2.0 (the "License");
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# you may not use this file except in compliance with the License.
...
...
official/nlp/xlnet/squad_utils.py
View file @
d7511194
# Copyright 202
1
The TensorFlow Authors. All Rights Reserved.
# Copyright 202
2
The TensorFlow Authors. All Rights Reserved.
#
#
# Licensed under the Apache License, Version 2.0 (the "License");
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# you may not use this file except in compliance with the License.
...
...
official/nlp/xlnet/training_utils.py
View file @
d7511194
# Copyright 202
1
The TensorFlow Authors. All Rights Reserved.
# Copyright 202
2
The TensorFlow Authors. All Rights Reserved.
#
#
# Licensed under the Apache License, Version 2.0 (the "License");
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# you may not use this file except in compliance with the License.
...
@@ -21,7 +21,7 @@ from typing import Any, Callable, Dict, Optional, Text
...
@@ -21,7 +21,7 @@ from typing import Any, Callable, Dict, Optional, Text
from
absl
import
logging
from
absl
import
logging
import
tensorflow
as
tf
import
tensorflow
as
tf
from
official.
nlp
.bert
import
model_training_utils
from
official.
legacy
.bert
import
model_training_utils
from
official.nlp.xlnet
import
data_utils
from
official.nlp.xlnet
import
data_utils
# pytype: disable=attribute-error
# pytype: disable=attribute-error
...
...
Prev
1
…
18
19
20
21
22
23
24
25
26
…
50
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