简体   繁体   English

Keras:从保存的模型中获取训练数据

[英]Keras: get training data from a saved model

Is it even possible? 它甚至可能吗? The model is saved by 该模型由。保存

ModelCheckpoint(model_path, save_best_only=True, monitor='val_acc', mode='max', save_weights_only=False)

Can I do something like this? 我可以这样做吗?

from keras.models import load_model
model = load_model(model_path)
X_train = model.inputs

No, this is not possible. 不,这是不可能的。 ModelCheckpoint with save_weights_only=False only saves the topology, the weights and the optimizer's state (if any) of the model. ModelCheckpointsave_weights_only=False不仅节省了模型的拓扑结构,重量和优化的状态(如果有的话)。 The training data is not saved along with the model, and model.inputs is just the list of the model's placeholders. 训练数据不会与模型一起保存,而model.inputs只是模型占位符的列表。

See also the source code for ModelCheckpoint . 另请参见ModelCheckpoint源代码

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM