TensorSpeech / TensorFlowASR

:zap: TensorFlowASR: Almost State-of-the-art Automatic Speech Recognition in Tensorflow 2. Supported languages that can use characters or subwords
https://huylenguyen.com/asr
Apache License 2.0
914 stars 242 forks source link

Segmentation fault (core dumped) #252

Open Typelias opened 2 years ago

Typelias commented 2 years ago

Hi!

I trained the DeepSpeech2 model using the example scripts. With the trained checkpoints I generated a tflite model using the provided conversion script. I can successfully load and allocate the tensors but as soon as I invoke it fails and gives me Segmentation fault (core dumped).

Code for loading the model:

import tensorflow as tf
import soundfile as sf
wav, rate = sf.read("x.flac", dtype='float32')

model = tf.lite.Interpreter("test.tflite")

outputIndex = model.get_output_details()[0]['index']
model.resize_tensor_input(0, wav.shape)
model.allocate_tensors()
model.set_tensor(0, wav)

model.invoke()

output = model.get_tensor(outputIndex)
print(output)
nglehuy commented 2 years ago

@Typelias Could you provide your tensorflow version?

Typelias commented 2 years ago

@usimarit TensorFlow version: '2.8.0' Do you need any more information?