【问题标题】:Problem when saving a machine learning keras model保存机器学习 keras 模型时出现问题
【发布时间】:2021-04-10 04:04:01
【问题描述】:

我按照这个关于 keras 的教程 https://keras.io/examples/nlp/semantic_similarity_with_bert/

我想用这个命令保存模型

model.save("saved_model/my_model")

我在保存模型时收到此警告 enter image description here

然后当我想加载模型以使用此命令时

 tf.keras.models.load_model('saved_model/my_model')

我收到了这个错误 enter image description here

这是保存模型的好方法吗?

【问题讨论】:

    标签: tensorflow machine-learning keras


    【解决方案1】:

    您的第一个结构在字典中。您必须从 dict 中提取项目才能摆脱您的错误。尝试检查this

    【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2023-03-21
    • 2016-10-27
    • 1970-01-01
    • 2017-06-08
    • 2015-11-18
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多