ariG23498 / mae-scalable-vision-learners

A TensorFlow 2.x implementation of Masked Autoencoders Are Scalable Vision Learners
https://keras.io/examples/vision/masked_image_modeling/
MIT License
76 stars 15 forks source link

Save decoder and encoder #19

Open joao-alcindo opened 1 year ago

joao-alcindo commented 1 year ago

How can I save the encoder and decoder of the model after pre training?

ariG23498 commented 1 year ago

Hey @joao-alcindo thanks for you interest in the work!

You could access the encoder and decoder individually like so 👇

encoder = mae_model.encoder
decoder = mae_model.decoder

Once you have that, you could simple use the encoder.save("encoder.keras") API to save each of them (here encoder) separately. Hope that helps 😄