![](/img/trans.png)
[英]What is the most efficient way to select a preexisting model in tensorflow
[英]What's the most efficient and/or easy way of exporting and using a TensorFlow model
Ive created a time series forecasting model (RNN) which is heavily based off this tutorial , If I wanted to export this model and use it with, say, a kivy UI in python, where I feed it some new data every time the program is運行它並預測一個小范圍的值,我將如何 go 這樣做? 我試圖查看 SavedModel 的東西,但我不確定在導出 model 后如何實現它。
使用日志保存很容易,檢查點格式可以直接保存和恢復,但需要通過目標負載 model 來指定模型。 用簡單的方法做,以后不會頭疼。
: 打回來
cp_callback = tf.keras.callbacks.ModelCheckpoint(checkpoint_path, monitor='val_loss', verbose=0, save_best_only=True, mode='min')
:加載權重
if exists(checkpoint_path): model_highscores.load_weights(checkpoint_path) print("model load:" + checkpoint_path) input("Press Any Key!")
: 用法
預測 = model_highscores.predict(img_array)
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.