resuming-training

Save and load custom optimizers for continued training in TensorFlow

妖精的绣舞 提交于 2020-06-24 14:53:07
问题 My question is essentially the exact same as that specified here but without using the Keras backend. Namely, how does one save and restore custom optimizers to their last state in TensorFlow (e.g. L-BFGS-B , Adam) when continuing training? As per the solution here for the Adam optimizer specifically, it appears one approach is to use tf.add_collection and tf.get_collection , but that appears to not work if I need to restore the optimizer in a new session/shell. I have written a simple test

What's the recommend way of restoring only parts model in distributed tensorflow

被刻印的时光 ゝ 提交于 2019-12-12 04:57:55
问题 When we finetune a model on a different task, only a part of vars in the model are restored from the pretrained task and others are left as initial values. As many docs recommends(page1 page2), when training with a local graph, restoring the pretrained model after running the global init op(call restoring in "init_fn" if MonitoredSession or supervisor is included). But in the distributed case, does global init op make "model_ready" returns true before the restoring-model called ? other non

Loading a trained Keras model and continue training

廉价感情. 提交于 2019-11-27 02:45:12
I was wondering if it was possible to save a partly trained Keras model and continue the training after loading the model again. The reason for this is that I will have more training data in the future and I do not want to retrain the whole model again. The functions which I am using are: #Partly train model model.fit(first_training, first_classes, batch_size=32, nb_epoch=20) #Save partly trained model model.save('partly_trained.h5') #Load partly trained model from keras.models import load_model model = load_model('partly_trained.h5') #Continue training model.fit(second_training, second

Loading a trained Keras model and continue training

…衆ロ難τιáo~ 提交于 2019-11-26 10:07:53
问题 I was wondering if it was possible to save a partly trained Keras model and continue the training after loading the model again. The reason for this is that I will have more training data in the future and I do not want to retrain the whole model again. The functions which I am using are: #Partly train model model.fit(first_training, first_classes, batch_size=32, nb_epoch=20) #Save partly trained model model.save(\'partly_trained.h5\') #Load partly trained model from keras.models import load