【问题标题】:Problem converting Keras Models into Layers API format models to use with tensorflow.js将 Keras 模型转换为 Layers API 格式模型以与 tensorflow.js 一起使用时出现问题
【发布时间】:2019-03-21 14:15:16
【问题描述】:

我在将 Keras 模型转换为 Layers API 格式模型以与 tensorflowjs 一起使用时遇到问题

我使用命令:

$ tensorflowjs_converter --input_format keras kerasModels/vgg16_weights_tf_dim_ordering_tf_kernels.h5 convertedModels/

我收到一个错误“KeyError: Can't open attribute (can't locate attribute 'keras version')”

这是错误日志的图像:

【问题讨论】:

    标签: tensorflow keras tensorflow.js tensorflowjs-converter


    【解决方案1】:

    我假设您正在尝试转换从here 下载的模型,该模型现在可能已过时。

    您可以使用以下 python 脚本从keras-applications 下载新的 VGG16 模型:

    from keras.applications.vgg16 import VGG16
    model = VGG16(include_top=True, weights='imagenet')
    model.save("VGG16.h5")
    

    【讨论】:

      猜你喜欢
      • 2019-11-15
      • 1970-01-01
      • 1970-01-01
      • 2019-05-14
      • 1970-01-01
      • 1970-01-01
      • 2021-08-04
      • 2017-10-06
      • 2021-04-24
      相关资源
      最近更新 更多