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

The UNIDIRECTIONAL_SEQUENCE_LSTM layer is not yet implemented. #14

Open
peiwenhuang27 opened this issue Jul 14, 2021 · 3 comments
Open
Labels
enhancement New feature or request feature_request

Comments

@peiwenhuang27
Copy link

OS you are using: MacOS 11.4

Version of TensorFlow: v2.5.0

Environment: Docker

Under tf 2.5.0, I converted my pre-trained model from saved_model to tflite.

Afterwards, in Docker container, when I was converting this tflite model to pb format using tflite2tensorflow, the following error occured:

ERROR: The UNIDIRECTIONAL_SEQUENCE_LSTM layer is not yet implemented.

(In this experiment, I did not perform quantization/optimization, but later on I do plan to use tflite to quantize my model that is to be saved as .tflite, which is why I did not directly convert saved_model to pb)

@PINTO0309 PINTO0309 added enhancement New feature or request feature_request labels Jul 14, 2021
@PINTO0309
Copy link
Owner

PINTO0309 commented Jul 14, 2021

In fact, I tried to implement that operation a month ago, but there were not enough samples of the model to create a good conversion program. To the extent possible, can you provide the following resources? The minimum amount of information that you are willing to disclose is fine.

  1. Source code for building the LSTM model.
  2. saved_model
  3. tflite file converted from saved_model

I'm having trouble with TFLite's UNIDIRECTIONAL_SEQUENCE_LSTM because it is very difficult to connect it to TensorFlow's standard operations.
Screenshot 2021-07-14 16:56:40

Thank you for your help.

@peiwenhuang27
Copy link
Author

Hi, sorry for the late reply. I have attached a zip file of my models (only initialized, without training) and source code, let me know if there's a problem with it!
By the way, I noticed that Quantize layer from tflite is also not yet implemented. Should I also provide some samples for that as well?

Thank you!

resources.zip

@PINTO0309
Copy link
Owner

Thank you! I'm very busy with my day job, so I'll examine it carefully when I have time.

By the way, I noticed that Quantize layer from tflite is also not yet implemented. Should I also provide some samples for that as well?

I am aware of this point as well. I do not need to provide resources as I have a large number of samples and I know that I can technically handle it. If you are in a hurry to convert your Quantize layer, you can try the following tool.
https://github.com/onnx/tensorflow-onnx

$ python -m tf2onnx.convert \
--opset 11 \
--tflite int8_quantized_tflite_xxxx.tflite \
--output model.onnx \
--dequantize

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request feature_request
Projects
None yet
Development

No branches or pull requests

2 participants