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
PiperOrigin-RevId: 281869018
  • Loading branch information
afrozenator committed Nov 22, 2019
1 parent 2565fbe commit 1317424
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 6 deletions.
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@
'tensor2tensor/bin/t2t-translate-all',
],
install_requires=[
'absl-py',
'bz2file',
'dopamine-rl',
'flask',
Expand Down Expand Up @@ -64,7 +65,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
8 changes: 3 additions & 5 deletions tensor2tensor/data_generators/audio.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,14 +19,12 @@
from __future__ import print_function

import os
from subprocess import call
import subprocess
import tarfile
import wave
# from tensor2tensor.data_generators import generator_utils

from absl import flags
import tensorflow as tf

flags = tf.flags
FLAGS = flags.FLAGS

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

0 comments on commit 1317424

Please sign in to comment.