Tensorflow Keras Copy Weights From One Model to Another Tensorflow Keras Copy Weights From One Model to Another python-3.x python-3.x

Tensorflow Keras Copy Weights From One Model to Another


Actually what you've done is much more than simply copying weights. You made these two models identical all the time. Every time you update one model - the second one is also updated - as both models have the same weights variables.

If you want to just copy weights - the simplest way is by this command:

target_model.set_weights(model.get_weights())