Fix init in synthesis & remove dry run
This commit is contained in:
parent
cf5f720b8f
commit
8505805dad
|
@ -93,16 +93,7 @@ def synthesize(config):
|
|||
|
||||
# Build model.
|
||||
model = WaveFlow(config, checkpoint_dir)
|
||||
model.build(training=False)
|
||||
# Obtain the current iteration.
|
||||
if config.checkpoint is None:
|
||||
if config.iteration is None:
|
||||
iteration = io.load_latest_checkpoint(checkpoint_dir)
|
||||
else:
|
||||
iteration = config.iteration
|
||||
else:
|
||||
iteration = int(config.checkpoint.split('/')[-1].split('-')[-1])
|
||||
|
||||
iteration = model.build(training=False)
|
||||
# Run model inference.
|
||||
model.infer(iteration)
|
||||
|
||||
|
|
|
@ -81,12 +81,6 @@ class WaveFlow():
|
|||
|
||||
waveflow = WaveFlowModule(config)
|
||||
|
||||
# Dry run once to create and initalize all necessary parameters.
|
||||
audio = dg.to_variable(np.random.randn(1, 16000).astype(self.dtype))
|
||||
mel = dg.to_variable(
|
||||
np.random.randn(1, config.mel_bands, 63).astype(self.dtype))
|
||||
waveflow(audio, mel)
|
||||
|
||||
if training:
|
||||
optimizer = fluid.optimizer.AdamOptimizer(
|
||||
learning_rate=config.learning_rate,
|
||||
|
|
Loading…
Reference in New Issue