【问题标题】:Edit model after loading it woth only the .h5 file仅使用 .h5 文件加载后编辑模型
【发布时间】:2022-12-11 19:04:49
【问题描述】:

这是我第一次在只有 .h5 文件的情况下加载模型。这就是我现在所做的:

import tensorflow as tf 
from tensorflow.keras.models import load_model
from keras.layers import Activation, Dense

new_model = load_model(filepath)

new_model.optimizer

new_model.get_weights()

我想知道有没有办法重新创建火车和测试数据?它们对于重新开始编辑保存的模型很重要还是有其他方法?谢谢您的帮助

【问题讨论】:

    标签: python tensorflow


    【解决方案1】:

    当您拥有经过训练的模型(无论实际格式如何)时,它就是体系结构和权重,训练和测试数据无论如何都不会“融合”到模型中,您无法从中检索它。

    【讨论】:

      猜你喜欢
      • 2019-08-03
      • 1970-01-01
      • 2020-12-11
      • 2021-11-19
      • 1970-01-01
      • 1970-01-01
      • 2021-06-04
      • 1970-01-01
      相关资源
      最近更新 更多