I tried using the checkpoint saver you suggested, but I got the following error:
WARNING:tensorflow:Saver is deprecated, please switch to tf.train.Checkpoint or tf.keras.Model.save_weights for training checkpoints. When executing eagerly variables do not necessarily have unique names, and so the variable.name-based lookups Saver performs are error-prone.
I am not sure which of the two options I am supposed to use. I tried both and tf.train.Checkpoint seems better, but I cannot restore it in another python script. Do you have any suggestions? Thanks!