调用代码如下, 求求各位大佬救救孩子
@tf.function(
experimental_relax_shapes=True,
input_signature=[
tf.TensorSpec(shape, dtype=tf.float32),
tf.TensorSpec([None, 1], dtype=tf.int32),
]
)
def recognize_tflite(features, length):
logits = self.call(features, training=False)
probs = tf.nn.softmax(logits)
decoded = tf.keras.backend.ctc_decode(
y_pred=probs, input_length=tf.squeeze(length, -1), greedy=True
)[0][0]
return [decoded]