python - 有没有办法通过 JavaScript 在我的网站中使用 TensorFlow 模型?

标签 python node.js tensorflow machine-learning keras

<分区>

我有一个 friend 使用 Python 和 TensorFlow 来构建机器学习模型。我想在我的网站中使用它,它在 nodejs 中有后端。

有没有办法将 TensorFlow 构建和训练的模型整合到 JavaScript 代码中,以便我可以在我的网站上提供基于机器学习的服务?

最佳答案

看看TensorFlow.js ,这是一个专门用于 TensorFlow 模型的基于浏览器的 JavaScript 库。

更具体地说,您很可能可以使用tf.loadModel() 将您 friend 的模型直接加载到您的网站中。然后在那里运行它。

importing a Keras model into TensorFlow.js 上有教程.希望您的 friend 知道 Keras 是什么以及如何在 Keras 中生成他的模型。

如果是直接的TensorFlow,那么就按照this guide如何将他的模型转换为 TensorFlow.js。

关于python - 有没有办法通过 JavaScript 在我的网站中使用 TensorFlow 模型?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/49966917/

相关文章:

tensorflow - 获取 TensorFlow 训练的模型中某些权重的值

angularjs - 注销后在 Angular js中重新加载页面

node.js - 尝试在Cipher.update中以不受支持的状态添加数据

python - Selenium 打开浏览器但不加载页面

python - CNTK中如何设置设备进行特定操作?

node.js - 如何在express js中获取json文件并显示在 View 中

python - 如何在 TensorFlow 回归中指定 2 个或更多输出标签

python - 如何获取张量的类型?

python - 使用 Matplotlib 散点图绘制数字而不是点

python - OpenCV模板匹配: Restrict search area