Skip to content

Commit c671c00

Browse files
committed
upload save
1 parent 6c98e21 commit c671c00

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

kerasTUT/10-save.py

+3-2
Original file line numberDiff line numberDiff line change
@@ -30,12 +30,13 @@
3030
cost = model.train_on_batch(X_train, Y_train)
3131

3232
# save
33-
model.save('my_model.h5') # HDF5 file
33+
print('test before save: ', model.predict(X_test[0:2]))
34+
model.save('my_model.h5') # HDF5 file, you have to pip3 install h5py if don't have it
3435
del model # deletes the existing model
3536

3637
# load
3738
model = load_model('my_model.h5')
38-
39+
print('test after load: ', model.predict(X_test[0:2]))
3940
"""
4041
# save and load weights
4142
model.save_weights('my_model_weights.h5')

0 commit comments

Comments
 (0)