tacotron icon indicating copy to clipboard operation
tacotron copied to clipboard

Using Griffin Lim without Tensorflow?

Open Clouxie opened this issue 6 years ago • 1 comments

Hey there

I actually can synthesize very good audio with "inv_spectrogram_tensorflow" method Can someone show me how to use GL without tensorflow? I've changed some code, and now it look's like this:

class Synthesizer:
  def load(self, checkpoint_path, model_name='tacotron'):
    inputs = tf.placeholder(tf.int32, [1, None], 'inputs')
    input_lengths = tf.placeholder(tf.int32, [1], 'input_lengths')
    with tf.variable_scope('model') as scope:
      self.model = create_model(model_name, hparams)
      self.model.initialize(inputs, input_lengths)
      self.wav_output = self.model.linear_outputs[0]
      print(self.model.linear_outputs)

    self.session = tf.InteractiveSession()
    self.session.run(tf.global_variables_initializer())
    saver = tf.train.Saver()
    saver.restore(self.session, checkpoint_path)

def synthesize(self, text):
    cleaner_names = [x.strip() for x in hparams.cleaners.split(',')]
    seq = text_to_sequence(text, cleaner_names)
    feed_dict = {
      self.model.inputs: [np.asarray(seq, dtype=np.int32)],
      self.model.input_lengths: np.asarray([len(seq)], dtype=np.int32)
    }
    wav = self.session.run(self.wav_output,feed_dict=feed_dict)
    music = audio.inv_spectrogram(wav)
    audio.save_wav(music,"bias.wav")

So as you see I'm grabbing BiasAdd:0 output as a directly input to the GL algorithm. Results are realy bad, and I have some dimension miss'matches inside it.

Thanks for help

Clouxie avatar Mar 28 '19 14:03 Clouxie

There's an example in the training code: https://github.com/keithito/tacotron/blob/a4f5ac3dfc596425206235d931e907b639a60ed4/train.py#L113

keithito avatar Apr 26 '19 01:04 keithito