Tf.recompute_grad in Tflite

I want to use tf.recompute_grad to reduce memory in tflite.

But it raised “Check the error log to see the error that was raised when converting a gradient function to a concrete function. You may need to update the custom gradient, or disable saving gradients with the option tf.saved_model.SaveOptions(custom_gradients=False).”

Is it possible to use tf.recompute_grad in tflite?


Welcome to the Tensorflow Forum!

The objective of tflite is to convert tensorflow models (saved models) to memory efficient binary (flatbuffers) which can be used for inference in memory constraint devices like mobiles, edge-devices.

Did you see the error while converting the model to tflite? If yes, can you please post stack trace and standalone code to reproduce the issue?

Thank you!