Rayhane-mamah / Tacotron-2

DeepMind's Tacotron-2 Tensorflow implementation
MIT License
2.25k stars 911 forks source link

Type of sequence_length in BiLSTM #508

Open tuong-olli opened 3 years ago

tuong-olli commented 3 years ago

Hi, Could you help me something about your code? In tacotron.py in line encoder_outputs = encoder_cell(embedded_inputs, tower_input_lengths[i]). You add tower_input_lengths[i] (this is a tensor) to EncoderRNN (this is a BiLSTM) with code:

def __call__(self, inputs, input_lengths):
                with tf.variable_scope(self.scope):
                        outputs, (fw_state, bw_state) = tf.nn.bidirectional_dynamic_rnn(
                                self._fw_cell,
                                self._bw_cell,
                                inputs,
                                sequence_length=input_lengths,
                                dtype=tf.float32,
                                swap_memory=True)

So sequence_length have to int type not tensor, but how you can do with tower_input_lengths[i], this is a tensor.