As I mentioned in a comment on the SO thread 7, computing gradients with TFLite models isn’t possible currently. The best you can do is to compute the gradients of the Keras model / SavedModel and produce the CAMs.