Set_weights in keras

I have built the model, trained it. Again I was trying to set weights to the model from a file saved in my local machine but I was getting errors. So, what are the things that we should care about while setting weights in the trained models?Thank you

What methods did you use to save the model weights and use them again?
If you need to reuse only the weights, that’s how you can save and reload them:
model.save_weights(‘name_or_path.h5’)
new_model.load_weights(‘name_or_path.h5’)
Architecture of “new_model” should be identical to “model”.