我可以在关机后继续机器学习过程吗?
数据挖掘
深度学习
朱庇特
2022-03-15 23:29:55
1个回答
为了继续学习过程,您需要使用检查点。
# source: https://stackoverflow.com/questions/36356004/continue-training-from-a-specific-epoch
weight_save_callback = ModelCheckpoint('/path/to/weights.{epoch:02d}-{val_loss:.2f}.hdf5', monitor='val_loss', verbose=0, save_best_only=False, mode='auto')
model.fit(X_train,y_train,batch_size=batch_size,nb_epoch=nb_epoch,callbacks=[weight_save_callback])
# load model
model = Sequential()
model.add(...)
model.load('path/to/weights.hf5')
# use model.fit to continue training.
其它你可能感兴趣的问题
