mirror of https://github.com/coqui-ai/TTS.git
tf_lite tacotron2 bug fix
This commit is contained in:
parent
b116bdaefa
commit
2d596aa140
|
@ -34,6 +34,4 @@ model = load_checkpoint(model, args.tf_model)
|
||||||
model.decoder.set_max_decoder_steps(1000)
|
model.decoder.set_max_decoder_steps(1000)
|
||||||
|
|
||||||
# create tflite model
|
# create tflite model
|
||||||
tflite_model = convert_tacotron2_to_tflite(model, output_path=args.output_path)
|
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.')
|
|
|
@ -16,6 +16,7 @@ def convert_tacotron2_to_tflite(model,
|
||||||
tf.lite.OpsSet.TFLITE_BUILTINS, tf.lite.OpsSet.SELECT_TF_OPS
|
tf.lite.OpsSet.TFLITE_BUILTINS, tf.lite.OpsSet.SELECT_TF_OPS
|
||||||
]
|
]
|
||||||
tflite_model = converter.convert()
|
tflite_model = converter.convert()
|
||||||
|
print(f'Tflite Model size is {len(tflite_model) / (1024.0 * 1024.0)} MBs.')
|
||||||
if output_path is not None:
|
if output_path is not None:
|
||||||
# same model binary if outputpath is provided
|
# same model binary if outputpath is provided
|
||||||
with open(output_path, 'wb') as f:
|
with open(output_path, 'wb') as f:
|
||||||
|
|
|
@ -51,7 +51,7 @@ class PQMF(tf.keras.layers.Layer):
|
||||||
|
|
||||||
def synthesis(self, x):
|
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.transpose(x, perm=[0, 2, 1])
|
||||||
x = tf.nn.conv1d_transpose(
|
x = tf.nn.conv1d_transpose(
|
||||||
|
|
Loading…
Reference in New Issue