I’m following this tutorial:
in which the encoder, decoder and optimiser are “checkpointed”. When I try to restore the checkpoint as follows:
encoder = Encoder(NUM_WORDS, EMBEDDING_DIM, UNITS, BATCH_SIZE)
decoder = Decoder(NUM_WORDS, 431, EMBEDDING_DIM, UNITS, BATCH_SIZE,
'luong')
optimiser = tf.keras.optimizers.Adam()
checkpoint = tf.train.Checkpoint(optimiser=optimiser,
encoder=encoder,
decoder=decoder)
checkpoint.restore(tf.train.latest_checkpoint(checkpoint_dirpath)).assert_consumed()
I have the following error:
AssertionError("Unresolved object in checkpoint {}: {}"
AssertionError: Unresolved object in checkpoint (root).optimiser.iter: attributes {
name: "VARIABLE_VALUE"
full_name: "Adam/iter"
checkpoint_key: "optimiser/iter/.ATTRIBUTES/VARIABLE_VALUE"
Without assert_consumed()
, I have no error but encoder
, decoder
and optimiser
are empty, and in doing so, not “checkpointed”.
I tried the solution proposed here:
without success.
Thank you in advance for your help.