Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do I list certain variables in the checkpoint?

I am working with autoencoders. My checkpoint contains the complete state of the network (i.e. the encoder, decoder, optimizer, etc). I want to fool around with the encodings. Therefore, I would only need the decoder part of the network in my evaluation mode.

How can I read only a few specific variables from the existing checkpoint, so that I can reuse their values in another model?

like image 472
y.selivonchyk Avatar asked Aug 14 '16 16:08

y.selivonchyk


People also ask

How do I get all the variables in Tensorflow?

If you want to get all the trainable variables, you can get all of them inside of a list using tf. trainable_variables method.

What is model Ckpt?

ModelCheckpoint callback is used in conjunction with training using model. fit() to save a model or weights (in a checkpoint file) at some interval, so the model or weights can be loaded later to continue the training from the state saved.


1 Answers

You can view the saved variables in .ckpt file using,

import tensorflow as tf

variables_in_checkpoint = tf.train.list_variables('path.ckpt')

print("Variables found in checkpoint file",variables_in_checkpoint)
like image 166
Prabakar Avatar answered Nov 15 '22 19:11

Prabakar