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

Commit

Permalink
Move from tf flags to absl flags, since they seem to be gone in tf 1.15
Browse files Browse the repository at this point in the history
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
  • Loading branch information
afrozenator committed Nov 22, 2019
1 parent 2594069 commit 313fdfc
Show file tree
Hide file tree
Showing 11 changed files with 18 additions and 22 deletions.
12 changes: 10 additions & 2 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,16 @@

setup(
name='tensor2tensor',
version='1.15.0',
version='1.15.1',
description='Tensor2Tensor',
long_description=(
'Tensor2Tensor, or T2T for short, is a library of '
'deep learning models and datasets designed to make deep '
'learning more accessible and accelerate ML research. '
'T2T was developed by researchers and engineers in the Google '
'Brain team and a community of users. It is now in maintenance '
'mode -- we keep it running and welcome bug-fixes, but encourage '
'users to use the successor library Trax.'),
author='Google Inc.',
author_email='no-reply@google.com',
url='http://github.com/tensorflow/tensor2tensor',
Expand All @@ -33,6 +41,7 @@
'tensor2tensor/bin/t2t-translate-all',
],
install_requires=[
'absl-py',
'bz2file',
'dopamine-rl',
'flask',
Expand Down Expand Up @@ -64,7 +73,6 @@
'tensorflow': ['tensorflow>=1.15.0'],
'tensorflow-hub': ['tensorflow-hub>=0.1.1'],
'tests': [
'absl-py',
# Needed to fix a Travis pytest error.
# https://github.com/Julian/jsonschema/issues/449#issuecomment-411406525
'attrs>=17.4.0',
Expand Down
3 changes: 1 addition & 2 deletions tensor2tensor/data_generators/audio.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,9 @@
import subprocess
import tarfile
import wave

from absl import flags
import tensorflow as tf

flags = tf.flags
FLAGS = flags.FLAGS

flags.DEFINE_string("timit_paths", "",
Expand Down
2 changes: 0 additions & 2 deletions tensor2tensor/data_generators/dialog_personachat.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,7 @@
from tensor2tensor.data_generators import dialog_abstract
from tensor2tensor.data_generators import text_encoder
from tensor2tensor.utils import registry
import tensorflow as tf

FLAGS = tf.flags.FLAGS

# End-of-sentence marker.
EOS = text_encoder.EOS_ID
Expand Down
1 change: 0 additions & 1 deletion tensor2tensor/data_generators/tokenizer_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@
from tensor2tensor.data_generators import tokenizer
import tensorflow as tf

FLAGS = tf.flags.FLAGS

pkg_dir, _ = os.path.split(__file__)
_TESTDATA = os.path.join(pkg_dir, "test_data")
Expand Down
2 changes: 0 additions & 2 deletions tensor2tensor/data_generators/translate.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,6 @@
import tensorflow as tf
import tf_slim as slim

FLAGS = tf.flags.FLAGS


class TranslateProblem(text_problems.Text2TextProblem):
"""Base class for translation problems."""
Expand Down
3 changes: 0 additions & 3 deletions tensor2tensor/data_generators/translate_encs.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,6 @@
from tensor2tensor.data_generators import translate
from tensor2tensor.utils import registry

import tensorflow as tf

FLAGS = tf.flags.FLAGS

# End-of-sentence marker.
EOS = text_encoder.EOS_ID
Expand Down
3 changes: 0 additions & 3 deletions tensor2tensor/data_generators/translate_enfr.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,6 @@
from tensor2tensor.data_generators import wiki_lm
from tensor2tensor.utils import registry

import tensorflow as tf

FLAGS = tf.flags.FLAGS

# End-of-sentence marker.
EOS = text_encoder.EOS_ID
Expand Down
1 change: 0 additions & 1 deletion tensor2tensor/data_generators/translate_enzh.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@

import tensorflow as tf

FLAGS = tf.flags.FLAGS

# End-of-sentence marker.
EOS = text_encoder.EOS_ID
Expand Down
6 changes: 3 additions & 3 deletions tensor2tensor/data_generators/video_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,10 @@

import functools
import os

from absl import flags
import numpy as np
import six

from tensor2tensor.data_generators import generator_utils
from tensor2tensor.data_generators import image_utils
from tensor2tensor.data_generators import problem
Expand All @@ -33,11 +34,10 @@
from tensor2tensor.layers import modalities
from tensor2tensor.utils import metrics
from tensor2tensor.utils import video_metrics

import tensorflow as tf
import tf_slim as slim

flags = tf.flags

FLAGS = flags.FLAGS

flags.DEFINE_bool(
Expand Down
2 changes: 1 addition & 1 deletion tensor2tensor/data_generators/wiki_revision.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@
import math
import random

from absl import flags
from tensor2tensor.data_generators import generator_utils
from tensor2tensor.data_generators import text_encoder
from tensor2tensor.data_generators import text_problems
Expand All @@ -40,7 +41,6 @@

import tensorflow as tf

flags = tf.flags
FLAGS = flags.FLAGS

flags.DEFINE_integer("wiki_revision_num_train_shards", 50,
Expand Down
5 changes: 3 additions & 2 deletions tensor2tensor/data_generators/wsj_parsing.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,15 +21,16 @@

import os

from absl import flags
from tensor2tensor.data_generators import problem
from tensor2tensor.data_generators import text_problems
from tensor2tensor.utils import registry
import tensorflow as tf

tf.flags.DEFINE_string("parsing_path", "", "Path to parsing files in tmp_dir.")
flags.DEFINE_string("parsing_path", "", "Path to parsing files in tmp_dir.")


FLAGS = tf.flags.FLAGS
FLAGS = flags.FLAGS


@registry.register_problem
Expand Down

0 comments on commit 313fdfc

Please sign in to comment.