tf_lite tacotron2 bug fix

This commit is contained in:
erogol 2020-07-14 17:48:17 +02:00
parent b116bdaefa
commit 2d596aa140
3 changed files with 3 additions and 4 deletions

View File

@ -34,6 +34,4 @@ model = load_checkpoint(model, args.tf_model)
model.decoder.set_max_decoder_steps(1000)
# create tflite model
tflite_model = convert_tacotron2_to_tflite(model, output_path=args.output_path)
print(f'Tflite Model size is {len(tflite_model) / (1024.0 * 1024.0)} MBs.')
tflite_model = convert_tacotron2_to_tflite(model, output_path=args.output_path)

View File

@ -16,6 +16,7 @@ def convert_tacotron2_to_tflite(model,
tf.lite.OpsSet.TFLITE_BUILTINS, tf.lite.OpsSet.SELECT_TF_OPS
]
tflite_model = converter.convert()
print(f'Tflite Model size is {len(tflite_model) / (1024.0 * 1024.0)} MBs.')
if output_path is not None:
# same model binary if outputpath is provided
with open(output_path, 'wb') as f:

View File

@ -51,7 +51,7 @@ class PQMF(tf.keras.layers.Layer):
def synthesis(self, x):
"""
x : B x 1 x T
x : B x D x T
"""
x = tf.transpose(x, perm=[0, 2, 1])
x = tf.nn.conv1d_transpose(