0

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 ?

WBR
  • 57
  • 1
  • 11

1 Answers1

0

momentum=0.9is saved when saving the model, so don't worry about it. Or you can make momentum a placeholder so you can load whatever you want when resotring models.

WBR
  • 57
  • 1
  • 11