Skip to content

Commit

Permalink
Adding version check
Browse files Browse the repository at this point in the history
- Using pkg_resources
- Test is done
  • Loading branch information
Yeongtae committed Aug 15, 2018
1 parent 75b5704 commit a70073b
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion hparams.py
Original file line number Diff line number Diff line change
Expand Up @@ -184,7 +184,7 @@

#During synthesis, there is no max_time_steps limitation so the model can sample much longer audio than 8k(or 13k) steps. (Audio can go up to 500k steps, equivalent to ~21sec on 24kHz)
#Usually your GPU can handle 1x~2x wavenet_batch_size during synthesis for the same memory amount during training (because no gradients to keep and ops to register for backprop)
wavenet_synthesis_batch_size = 4 * 2, #This ensure that wavenet synthesis goes up to 4x~8x faster when synthesizing multiple sentences. Watch out for OOM with long audios.
wavenet_synthesis_batch_size = 2, #This ensure that wavenet synthesis goes up to 4x~8x faster when synthesizing multiple sentences. Watch out for OOM with long audios.

wavenet_learning_rate = 1e-3,
wavenet_adam_beta1 = 0.9,
Expand Down
8 changes: 4 additions & 4 deletions tacotron/models/custom_decoder.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
from tensorflow.python.layers import base as layers_base
from tensorflow.python.ops import rnn_cell_impl
from tensorflow.python.util import nest

from pkg_resources import parse_version

class CustomDecoderOutput(
collections.namedtuple("CustomDecoderOutput", ("rnn_output", "token_output", "sample_id"))):
Expand Down Expand Up @@ -40,11 +40,11 @@ def __init__(self, cell, helper, initial_state, output_layer=None):
Raises:
TypeError: if `cell`, `helper` or `output_layer` have an incorrect type.
"""
if (tf.__version__ < '1.10'):
if (parse_version(tf.__version__) >= parse_version('1.10')):
rnn_cell_impl.assert_like_rnncell(type(cell), cell)
else:
if not rnn_cell_impl._like_rnncell(cell): # pylint: disable=protected-access
raise TypeError("cell must be an RNNCell, received: %s" % type(cell))
else:
rnn_cell_impl.assert_like_rnncell(type(cell), cell)
if not isinstance(helper, helper_py.Helper):
raise TypeError("helper must be a Helper, received: %s" % type(helper))
if (output_layer is not None
Expand Down

0 comments on commit a70073b

Please sign in to comment.