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
c21bec54
Commit
c21bec54
authored
Sep 13, 2019
by
Hongkun Yu
Committed by
A. Unique TensorFlower
Sep 13, 2019
Browse files
Fix xlnet imports
PiperOrigin-RevId: 268968289
parent
956f295f
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
8 additions
and
7 deletions
+8
-7
official/nlp/xlnet/preprocess_pretrain_data.py
official/nlp/xlnet/preprocess_pretrain_data.py
+2
-1
official/nlp/xlnet/run_classifier.py
official/nlp/xlnet/run_classifier.py
+2
-2
official/nlp/xlnet/run_pretrain.py
official/nlp/xlnet/run_pretrain.py
+2
-2
official/nlp/xlnet/run_squad.py
official/nlp/xlnet/run_squad.py
+2
-2
No files found.
official/nlp/xlnet/preprocess_pretrain_data.py
View file @
c21bec54
...
@@ -23,6 +23,7 @@ import json
...
@@ -23,6 +23,7 @@ import json
import
os
import
os
import
random
import
random
from
absl
import
app
from
absl
import
flags
from
absl
import
flags
import
absl.logging
as
_logging
# pylint: disable=unused-import
import
absl.logging
as
_logging
# pylint: disable=unused-import
...
@@ -994,4 +995,4 @@ if __name__ == "__main__":
...
@@ -994,4 +995,4 @@ if __name__ == "__main__":
"using multiple workers to identify each worker."
)
"using multiple workers to identify each worker."
)
tf
.
logging
.
set_verbosity
(
tf
.
logging
.
INFO
)
tf
.
logging
.
set_verbosity
(
tf
.
logging
.
INFO
)
absl_
app
.
run
(
create_data
)
app
.
run
(
create_data
)
official/nlp/xlnet/run_classifier.py
View file @
c21bec54
...
@@ -27,13 +27,13 @@ from absl import logging
...
@@ -27,13 +27,13 @@ from absl import logging
import
numpy
as
np
import
numpy
as
np
import
tensorflow
as
tf
import
tensorflow
as
tf
# pylint: disable=unused-import
# pylint: disable=unused-import
# Initialize TPU System.
from
official.nlp
import
xlnet_config
from
official.nlp
import
xlnet_config
from
official.nlp
import
xlnet_modeling
as
modeling
from
official.nlp
import
xlnet_modeling
as
modeling
from
official.nlp.xlnet
import
common_flags
from
official.nlp.xlnet
import
common_flags
from
official.nlp.xlnet
import
data_utils
from
official.nlp.xlnet
import
data_utils
from
official.nlp.xlnet
import
optimization
from
official.nlp.xlnet
import
optimization
from
official.nlp.xlnet
import
training_utils
from
official.nlp.xlnet
import
training_utils
from
official.utils.misc
import
tpu_lib
flags
.
DEFINE_integer
(
"n_class"
,
default
=
2
,
help
=
"Number of classes."
)
flags
.
DEFINE_integer
(
"n_class"
,
default
=
2
,
help
=
"Number of classes."
)
...
@@ -135,7 +135,7 @@ def main(unused_argv):
...
@@ -135,7 +135,7 @@ def main(unused_argv):
if
FLAGS
.
strategy_type
==
"mirror"
:
if
FLAGS
.
strategy_type
==
"mirror"
:
strategy
=
tf
.
distribute
.
MirroredStrategy
()
strategy
=
tf
.
distribute
.
MirroredStrategy
()
elif
FLAGS
.
strategy_type
==
"tpu"
:
elif
FLAGS
.
strategy_type
==
"tpu"
:
# Initialize TPU System.
cluster_resolver
=
tpu_lib
.
tpu_initialize
(
FLAGS
.
tpu
)
cluster_resolver
=
tpu_lib
.
tpu_initialize
(
FLAGS
.
tpu
)
strategy
=
tf
.
distribute
.
experimental
.
TPUStrategy
(
cluster_resolver
)
strategy
=
tf
.
distribute
.
experimental
.
TPUStrategy
(
cluster_resolver
)
use_remote_tpu
=
True
use_remote_tpu
=
True
...
...
official/nlp/xlnet/run_pretrain.py
View file @
c21bec54
...
@@ -26,13 +26,13 @@ from absl import flags
...
@@ -26,13 +26,13 @@ from absl import flags
from
absl
import
logging
from
absl
import
logging
import
tensorflow
as
tf
import
tensorflow
as
tf
# pylint: disable=unused-import
# pylint: disable=unused-import
# Initialize TPU System.
from
official.nlp
import
xlnet_config
from
official.nlp
import
xlnet_config
from
official.nlp
import
xlnet_modeling
as
modeling
from
official.nlp
import
xlnet_modeling
as
modeling
from
official.nlp.xlnet
import
common_flags
from
official.nlp.xlnet
import
common_flags
from
official.nlp.xlnet
import
data_utils
from
official.nlp.xlnet
import
data_utils
from
official.nlp.xlnet
import
optimization
from
official.nlp.xlnet
import
optimization
from
official.nlp.xlnet
import
training_utils
from
official.nlp.xlnet
import
training_utils
from
official.utils.misc
import
tpu_lib
flags
.
DEFINE_integer
(
flags
.
DEFINE_integer
(
"mask_alpha"
,
default
=
6
,
help
=
"How many tokens to form a group."
)
"mask_alpha"
,
default
=
6
,
help
=
"How many tokens to form a group."
)
...
@@ -66,7 +66,7 @@ def main(unused_argv):
...
@@ -66,7 +66,7 @@ def main(unused_argv):
if
FLAGS
.
strategy_type
==
"mirror"
:
if
FLAGS
.
strategy_type
==
"mirror"
:
strategy
=
tf
.
distribute
.
MirroredStrategy
()
strategy
=
tf
.
distribute
.
MirroredStrategy
()
elif
FLAGS
.
strategy_type
==
"tpu"
:
elif
FLAGS
.
strategy_type
==
"tpu"
:
# Initialize TPU System.
cluster_resolver
=
tpu_lib
.
tpu_initialize
(
FLAGS
.
tpu
)
cluster_resolver
=
tpu_lib
.
tpu_initialize
(
FLAGS
.
tpu
)
strategy
=
tf
.
distribute
.
experimental
.
TPUStrategy
(
cluster_resolver
)
strategy
=
tf
.
distribute
.
experimental
.
TPUStrategy
(
cluster_resolver
)
use_remote_tpu
=
True
use_remote_tpu
=
True
...
...
official/nlp/xlnet/run_squad.py
View file @
c21bec54
...
@@ -30,7 +30,6 @@ from absl import logging
...
@@ -30,7 +30,6 @@ from absl import logging
import
tensorflow
as
tf
import
tensorflow
as
tf
# pylint: disable=unused-import
# pylint: disable=unused-import
# Initialize TPU System.
from
official.nlp
import
xlnet_config
from
official.nlp
import
xlnet_config
from
official.nlp
import
xlnet_modeling
as
modeling
from
official.nlp
import
xlnet_modeling
as
modeling
from
official.nlp.xlnet
import
common_flags
from
official.nlp.xlnet
import
common_flags
...
@@ -38,6 +37,7 @@ from official.nlp.xlnet import data_utils
...
@@ -38,6 +37,7 @@ from official.nlp.xlnet import data_utils
from
official.nlp.xlnet
import
optimization
from
official.nlp.xlnet
import
optimization
from
official.nlp.xlnet
import
squad_utils
from
official.nlp.xlnet
import
squad_utils
from
official.nlp.xlnet
import
training_utils
from
official.nlp.xlnet
import
training_utils
from
official.utils.misc
import
tpu_lib
flags
.
DEFINE_string
(
flags
.
DEFINE_string
(
"test_feature_path"
,
default
=
None
,
help
=
"Path to feature of test set."
)
"test_feature_path"
,
default
=
None
,
help
=
"Path to feature of test set."
)
...
@@ -227,7 +227,7 @@ def main(unused_argv):
...
@@ -227,7 +227,7 @@ def main(unused_argv):
if
FLAGS
.
strategy_type
==
"mirror"
:
if
FLAGS
.
strategy_type
==
"mirror"
:
strategy
=
tf
.
distribute
.
MirroredStrategy
()
strategy
=
tf
.
distribute
.
MirroredStrategy
()
elif
FLAGS
.
strategy_type
==
"tpu"
:
elif
FLAGS
.
strategy_type
==
"tpu"
:
# Initialize TPU System.
cluster_resolver
=
tpu_lib
.
tpu_initialize
(
FLAGS
.
tpu
)
cluster_resolver
=
tpu_lib
.
tpu_initialize
(
FLAGS
.
tpu
)
strategy
=
tf
.
distribute
.
experimental
.
TPUStrategy
(
cluster_resolver
)
strategy
=
tf
.
distribute
.
experimental
.
TPUStrategy
(
cluster_resolver
)
use_remote_tpu
=
True
use_remote_tpu
=
True
...
...
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