Skip to content
This repository was archived by the owner on Jul 7, 2023. It is now read-only.

Commit 313fdfc

Browse files
committed
Move from tf flags to absl flags, since they seem to be gone in tf 1.15
NOTE: This is only for libraries (and not binaries) in data_generators/ Also bump up version to 1.15.1 Also add a description to show on PyPI PiperOrigin-RevId: 282056584
1 parent 2594069 commit 313fdfc

11 files changed

+18
-22
lines changed

setup.py

+10-2
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,16 @@
55

66
setup(
77
name='tensor2tensor',
8-
version='1.15.0',
8+
version='1.15.1',
99
description='Tensor2Tensor',
10+
long_description=(
11+
'Tensor2Tensor, or T2T for short, is a library of '
12+
'deep learning models and datasets designed to make deep '
13+
'learning more accessible and accelerate ML research. '
14+
'T2T was developed by researchers and engineers in the Google '
15+
'Brain team and a community of users. It is now in maintenance '
16+
'mode -- we keep it running and welcome bug-fixes, but encourage '
17+
'users to use the successor library Trax.'),
1018
author='Google Inc.',
1119
author_email='[email protected]',
1220
url='http://github.com/tensorflow/tensor2tensor',
@@ -33,6 +41,7 @@
3341
'tensor2tensor/bin/t2t-translate-all',
3442
],
3543
install_requires=[
44+
'absl-py',
3645
'bz2file',
3746
'dopamine-rl',
3847
'flask',
@@ -64,7 +73,6 @@
6473
'tensorflow': ['tensorflow>=1.15.0'],
6574
'tensorflow-hub': ['tensorflow-hub>=0.1.1'],
6675
'tests': [
67-
'absl-py',
6876
# Needed to fix a Travis pytest error.
6977
# https://github.com/Julian/jsonschema/issues/449#issuecomment-411406525
7078
'attrs>=17.4.0',

tensor2tensor/data_generators/audio.py

+1-2
Original file line numberDiff line numberDiff line change
@@ -22,10 +22,9 @@
2222
import subprocess
2323
import tarfile
2424
import wave
25-
25+
from absl import flags
2626
import tensorflow as tf
2727

28-
flags = tf.flags
2928
FLAGS = flags.FLAGS
3029

3130
flags.DEFINE_string("timit_paths", "",

tensor2tensor/data_generators/dialog_personachat.py

-2
Original file line numberDiff line numberDiff line change
@@ -27,9 +27,7 @@
2727
from tensor2tensor.data_generators import dialog_abstract
2828
from tensor2tensor.data_generators import text_encoder
2929
from tensor2tensor.utils import registry
30-
import tensorflow as tf
3130

32-
FLAGS = tf.flags.FLAGS
3331

3432
# End-of-sentence marker.
3533
EOS = text_encoder.EOS_ID

tensor2tensor/data_generators/tokenizer_test.py

-1
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,6 @@
2727
from tensor2tensor.data_generators import tokenizer
2828
import tensorflow as tf
2929

30-
FLAGS = tf.flags.FLAGS
3130

3231
pkg_dir, _ = os.path.split(__file__)
3332
_TESTDATA = os.path.join(pkg_dir, "test_data")

tensor2tensor/data_generators/translate.py

-2
Original file line numberDiff line numberDiff line change
@@ -34,8 +34,6 @@
3434
import tensorflow as tf
3535
import tf_slim as slim
3636

37-
FLAGS = tf.flags.FLAGS
38-
3937

4038
class TranslateProblem(text_problems.Text2TextProblem):
4139
"""Base class for translation problems."""

tensor2tensor/data_generators/translate_encs.py

-3
Original file line numberDiff line numberDiff line change
@@ -24,9 +24,6 @@
2424
from tensor2tensor.data_generators import translate
2525
from tensor2tensor.utils import registry
2626

27-
import tensorflow as tf
28-
29-
FLAGS = tf.flags.FLAGS
3027

3128
# End-of-sentence marker.
3229
EOS = text_encoder.EOS_ID

tensor2tensor/data_generators/translate_enfr.py

-3
Original file line numberDiff line numberDiff line change
@@ -28,9 +28,6 @@
2828
from tensor2tensor.data_generators import wiki_lm
2929
from tensor2tensor.utils import registry
3030

31-
import tensorflow as tf
32-
33-
FLAGS = tf.flags.FLAGS
3431

3532
# End-of-sentence marker.
3633
EOS = text_encoder.EOS_ID

tensor2tensor/data_generators/translate_enzh.py

-1
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,6 @@
2929

3030
import tensorflow as tf
3131

32-
FLAGS = tf.flags.FLAGS
3332

3433
# End-of-sentence marker.
3534
EOS = text_encoder.EOS_ID

tensor2tensor/data_generators/video_utils.py

+3-3
Original file line numberDiff line numberDiff line change
@@ -21,9 +21,10 @@
2121

2222
import functools
2323
import os
24+
25+
from absl import flags
2426
import numpy as np
2527
import six
26-
2728
from tensor2tensor.data_generators import generator_utils
2829
from tensor2tensor.data_generators import image_utils
2930
from tensor2tensor.data_generators import problem
@@ -33,11 +34,10 @@
3334
from tensor2tensor.layers import modalities
3435
from tensor2tensor.utils import metrics
3536
from tensor2tensor.utils import video_metrics
36-
3737
import tensorflow as tf
3838
import tf_slim as slim
3939

40-
flags = tf.flags
40+
4141
FLAGS = flags.FLAGS
4242

4343
flags.DEFINE_bool(

tensor2tensor/data_generators/wiki_revision.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@
3131
import math
3232
import random
3333

34+
from absl import flags
3435
from tensor2tensor.data_generators import generator_utils
3536
from tensor2tensor.data_generators import text_encoder
3637
from tensor2tensor.data_generators import text_problems
@@ -40,7 +41,6 @@
4041

4142
import tensorflow as tf
4243

43-
flags = tf.flags
4444
FLAGS = flags.FLAGS
4545

4646
flags.DEFINE_integer("wiki_revision_num_train_shards", 50,

tensor2tensor/data_generators/wsj_parsing.py

+3-2
Original file line numberDiff line numberDiff line change
@@ -21,15 +21,16 @@
2121

2222
import os
2323

24+
from absl import flags
2425
from tensor2tensor.data_generators import problem
2526
from tensor2tensor.data_generators import text_problems
2627
from tensor2tensor.utils import registry
2728
import tensorflow as tf
2829

29-
tf.flags.DEFINE_string("parsing_path", "", "Path to parsing files in tmp_dir.")
30+
flags.DEFINE_string("parsing_path", "", "Path to parsing files in tmp_dir.")
3031

3132

32-
FLAGS = tf.flags.FLAGS
33+
FLAGS = flags.FLAGS
3334

3435

3536
@registry.register_problem

0 commit comments

Comments
 (0)