[英]Use Machine Learning Model in Pretrained Manner Keras, Tensorflow
I built a CNN model for image classification using the Keras library. 我使用Keras库为图像分类建立了CNN模型。 However training takes many hours.
但是培训需要很多小时。 Once I trained my model, how can I use it without training once more?
训练模型后,如何在不进行训练的情况下使用它? I mean after I trained my model, I want to use it many times.
我的意思是说,在训练模型后,我想多次使用它。 Because I will use my model in android studio.
因为我将在android studio中使用我的模型。 Any help is appreciated
任何帮助表示赞赏
Thank YOU... 谢谢...
When I wrote this question, I did not know the save model and load.model, in the answers you see the appropriate usage of them. 当我写这个问题时,我不知道保存模型和load.model,在答案中您看到它们的适当用法。
You can easily save your model after the training process by using: 在训练过程之后,您可以使用以下方法轻松保存模型:
model.save('my_model.h5')
you can later load that model by using: 您以后可以使用以下方式加载该模型:
model = load_model('my_model.h5')
for more details have a look at the documentation: https://keras.io/getting-started/faq/#how-can-i-save-a-keras-model 有关更多详细信息,请参阅文档: https : //keras.io/getting-started/faq/#how-can-i-save-a-keras-model
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.