I am trying to implement VGG-16 architecture in TensorFlow.

As mentioned in the paper, they changed the learning rate 3 time during their 74 epochs of training.

def optimizer(lr):
    return tf.train.MomentumOptimizer(learning_rate = lr)

But when I tried to change the learning rate in tensorflow,

opt_momentum = optimizer(lr)
opt = opt_momentum.minimize(cost)

I get the following error

FailedPreconditionError (see above for traceback): Attempting to use 
uninitialized value fully_connected_2/biases/Momentum_1

I use builder = tf.saved_model.builder.SavedModelBuilder(export_dir) to save the model.

However. I can't understand how to load the trained weights to initialize the layers after changing the learning_rate?

For changing the learning, I am calling the function optimizer with a new learning rate as argument, which is return me a new op but the error says that the layers are uninitialized.



Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.