如何使用 keras/tensorflow 将 tfjs 模型加载到 python 中

the*_*ter 5 javascript python keras tensorflow tensorflow.js

我有一个预先训练的 tfjs 模型,我想使用 keras/tensorflow 将其加载到 python 中

我找到了如何将 tf 和keras 模型转换为 tfjs 模型。以及如何使用js加载tfjs模型

如何将模型加载到 python 中?

Ble*_*Key 3

您可以使用模型保存 API从 JS 保存 tfjs 模型。

然后,您可以使用tfjs-converter将模型转换为 python 兼容格式。最后,您应该能够使用 keras 加载模型 API 在 python 中使用 load_model。

tf.keras.models.load_model(
   filepath,
   custom_objects=None,
   compile=True
)
Run Code Online (Sandbox Code Playgroud)