Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

RNN-Transducer TFlite conversion Broken #247

Open
SupreethRao99 opened this issue Feb 19, 2022 · 2 comments
Open

RNN-Transducer TFlite conversion Broken #247

SupreethRao99 opened this issue Feb 19, 2022 · 2 comments
Labels
bug Something isn't working need to reproduce Need a code or time to reproduce the issue

Comments

@SupreethRao99
Copy link

Hello,

Im trying to convert a pertained model trained on librispeech, but I run into the following error

tensorflow.lite.python.convert_phase.ConverterError: input resource[0] expected type resource != float, the type of streaming_transducer_greedy_while_streaming_transducer_decoder_streaming_transducer_prediction_embedding_embedding_lookup_11394_0[0]
        In {{node streaming_transducer_greedy/while/streaming_transducer_decoder/streaming_transducer_prediction_embedding/embedding_lookup}}
        Failed to functionalize Control Flow V1 ops. Consider using Control Flow V2 ops instead. See https://www.tensorflow.org/api_docs/python/tf/compat/v1/enable_control_flow_v2.

to run the tflite conversion, I ran the below code

python3 examples/rnn_transducer/tflite.py --saved Librispeech/25.h5 --subwords output rnnt.tflite

Platform
OS : MacOS 10.15.7
Python : 3.9
Tensorflow-cpu : 2.6.3

Could you suggest a possible way to convert a model to tflite as installing tf-nightly causes dependency issues and does not allow any code to be run at all.

Thank You!

@nglehuy nglehuy added bug Something isn't working need to reproduce Need a code or time to reproduce the issue labels Sep 2, 2022
@liuyibox
Copy link

Any updated solution here? I encountered the same issue here with tf2.9.

@liuyibox
Copy link

This bug has been resolved tensorflow/tensorflow#42410 (comment). Basically, we just need to load model while are are loading the concrete function, i.e., change this line to converter = tf.lite.TFLiteConverter.from_concrete_functions([concrete_func], model).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working need to reproduce Need a code or time to reproduce the issue
Projects
None yet
Development

No branches or pull requests

3 participants