For the data-set I'm working with, I have trained and saved a h5py model already using Keras. Now I have to add new data to the pre-trained model and use this new data in the training set. But I do not want to re-train the whole data-set as it took about 7 hours to train and save the model already. What are the methods that are currently available to add any new data to already trained model?
I do not want to retrain the whole model is because I do not have large data-set to add. I want to include the new data without training the model from the scratch because of time constraints.
How to add this new data?
I am hoping that you used model.save(), If you did then you can
from keras.models import load_model
model=load_model(<your path>)
and it is just your regular model, you can train it, predict with it whatever you want
model.compile(optimizer='adam',loss='binary_crossentropy', metrics=['accuracy'])
model.fit(train_data, train_labels,epochs=epochs,batch_size=batch_size,validation_data=(validation_data, validation_labels))
and whatever you want to do
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.