Here is the thing.
I build a trained network and save .meta and .data in ckpt. The optimizer is MomentumOptimizer:
tf.train.MomentumOptimizer(learning_rate=lr, momentum=0.9, name='Momentum')
,
which is also saved in .meta.
But I forget to save paramters to do with Momentum, So when I load graph form .meta, there will be Error:
Attempting to use uninitialized value fc.bias/Momentum
I know that I can use initializer() , but in this way how to set
momentum=0.9
? would this initializer() just give a random values to momentum
?
I have trained the model for a long time, there is not way for me to train it from scratch again to save xx/Momentum. So what can I do to fix it? That is, how can I set momentum=0.9
in MomentumOptimizer when loading .meta ?