也许您想查看这个tutoiral。 最简单的代码: from keras.models import load_model model.save('my_model.h5') # creates a HDF5 file 'my_model.h5' # returns a compiled model # identical to the previous one model = load_model('my_model.h5')