Skip to content

Commit

Permalink
Merge pull request Rayhane-mamah#154 from Yeongtae/master
Browse files Browse the repository at this point in the history
Fix assert_like_rnncell not found error using version check
  • Loading branch information
Rayhane-mamah authored Aug 15, 2018
2 parents e244457 + 90a9ada commit d13dbba
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 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,7 +40,11 @@ def __init__(self, cell, helper, initial_state, output_layer=None):
Raises:
TypeError: if `cell`, `helper` or `output_layer` have an incorrect type.
"""
rnn_cell_impl.assert_like_rnncell(type(cell), cell)
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))
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 d13dbba

Please sign in to comment.