How to restore weights with different names but same shapes Tensorflow?
tf.train.Saver has builtin support for that using a dictionary for the var_list
argument. This dictionary maps the names of the objects in the checkpoint file to your variables you want to restore.
If you want to restore your "joint network" with a checkpoint of your "selector network", you can do it like this:
# var1 is the variable you want ot restore
saver = tf.train.Saver(var_list={'selector_network/c2w/var1': var1})
saver.restore(...)
If you want to restore more variables, you simply have to extend the dictionary.