I want to load checkpoint file, change shapes of some variables ((1,1,1024,55)
-> (1,1,1024,60)
) and then save checkpoint again
What I've done:
1. I've loaded checkpoint
saver = tf.train.import_meta_graph(meta)
saver.restore(sess, ckpt
Tried to use
tf.assign()
:for var in tf.global_variables(): if var.name == "22-convolutional/biases:0": assign = tf.assign(var, a, validate_shape=False) sess.run(assign)
And then, when I am trying to execute
sess.run(tf.global_variables_initializer())
I have an error
Assign requires shapes of both tensors to match. lhs shape= [1,1,1024,60] rhs shape= [1,1,1024,55]
[[Node: 22-convolutional/kernel/Adam_1/Assign = Assign[T=DT_FLOAT,
_class=["loc:@22-convolutional/kernel"], use_locking=true, validate_shape=true,
_device="/job:localhost/replica:0/task:0/cpu:0"](22-convolutional/kernel/Adam_1, zeros_51)]]
Is there any ideas of what to try?
Thank you!