title: Saving the weights of VGG-16 model trained in keras
body: <p>How to save the weights of VGG-16 model after training it? How to load the saved weights in to the model?</p>
  
  <p>I tried this:</p>
  
  <pre><code>fname = "weights-Test-CNN.hdf5"
  
  custom_vgg_model.save_weights(fname,overwrite=True)
  custom_vgg_model.load_weights(weights-Test-CNN.hdf5, by_name=False)
  </code></pre>
  
  <hr>
  
  <p>I got following error:</p>
  
  <blockquote>
    <p>NameError                                 Traceback (most recent call
    last)  in ()
    ----> 1 custom_vgg_model.load_weights(weights-Test-CNN.hdf5, by_name=False)</p>
    
    <p>NameError: name 'weights' is not defined</p>
  </blockquote>