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

Commit 1317424

Browse files
committed
Move from tf flags to absl flags, since they seem to be gone in tf 1.15
PiperOrigin-RevId: 281869018
1 parent 2565fbe commit 1317424

File tree

2 files changed

+4
-6
lines changed

2 files changed

+4
-6
lines changed

setup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@
3333
'tensor2tensor/bin/t2t-translate-all',
3434
],
3535
install_requires=[
36+
'absl-py',
3637
'bz2file',
3738
'dopamine-rl',
3839
'flask',
@@ -64,7 +65,6 @@
6465
'tensorflow': ['tensorflow>=1.15.0'],
6566
'tensorflow-hub': ['tensorflow-hub>=0.1.1'],
6667
'tests': [
67-
'absl-py',
6868
# Needed to fix a Travis pytest error.
6969
# https://github.com/Julian/jsonschema/issues/449#issuecomment-411406525
7070
'attrs>=17.4.0',

tensor2tensor/data_generators/audio.py

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -19,14 +19,12 @@
1919
from __future__ import print_function
2020

2121
import os
22-
from subprocess import call
22+
import subprocess
2323
import tarfile
2424
import wave
25-
# from tensor2tensor.data_generators import generator_utils
26-
25+
from absl import flags
2726
import tensorflow as tf
2827

29-
flags = tf.flags
3028
FLAGS = flags.FLAGS
3129

3230
flags.DEFINE_string("timit_paths", "",
@@ -78,7 +76,7 @@ def _get_audio_data(filepath):
7876
# Construct a true .wav file.
7977
out_filepath = filepath.strip(".WAV") + ".wav"
8078
# Assumes sox is installed on system. Sox converts from NIST SPHERE to WAV.
81-
call(["sox", filepath, out_filepath])
79+
subprocess.call(["sox", filepath, out_filepath])
8280
wav_file = wave.open(open(out_filepath))
8381
frame_count = wav_file.getnframes()
8482
byte_array = wav_file.readframes(frame_count)

0 commit comments

Comments
 (0)