如何在线托管TensorFlow模型

huangapple go评论95阅读模式
英文:

How to host tensorflow model online

问题

我正在尝试使用TensorFlow Serving将ML模型作为REST API提供服务。

我想知道是否有一种方式可以将模型托管在线而不是在本地?

非常感谢提前帮助。

我需要托管一个ML模型,在进行预测时需要将字符串ID与其映射。

模型是一个.h5文件。

程序在笔记本中运行。但是在开发移动应用程序时,我不知道如何进行托管。

英文:

I'm trying to serve an ML Model as REST API using TensorFlow Serving.

I want to know whether there's a way to host the model online rather than locally?

Thanks a lot in advance.

I need to host a ML model where there's a mapping going with a string id when doing predictions.

The model is a .h5 file.

The program runs in a notebook. But I don't know how to do the hosting, when developing the mobile app.

答案1

得分: 1

可能最简单的解决方案是将您的模型打包到Docker容器中,并在AWS EC2或DigitalOcean等任何VPS上进行托管。

有一篇介绍创建容器过程的中文文章。它可能有点老,但今天仍然大部分适用。

使用 TensorFlow Serving 和 Docker 快速提供 ML 服务

在你有了容器之后,你可以按照任何描述如何将其发布到云上的指南进行操作。

例如:

在 10 分钟内部署到 AWS,使用 Docker | Milan McGraw | Geek Culture | Medium

另外,如果您不一定需要使用 TensorFlow Serving,可以研究一些专门设计用于简化部署过程的项目,比如 BentoML。我确信有很多在线指南描述了如何在任何平台上托管应用程序。

BentoML: 构建、部署和扩展 AI 应用

英文:

Probably the easiest solution would be to pack your model into a docker container and host it on any VPS like AWS EC2 or DigitalOcean.

There is a medium article that describes the process of creating the container. It is rather old, but should be mostly relevant even today.

Serving ML Quickly with TensorFlow Serving and Docker

After you have your container, you can follow any guide that describes how to publish it to the cloud.

For example:

Deploy to AWS, Docker in 10 Minutes! | by Milan McGraw | Geek Culture | Medium

Also, if you do not strictly need to use tf serving, you could look into some projects specifically designed to ease the deployment process like BentoML. I am confident there are plenty of guides online that describe how to host the app on any platform.

BentoML: Build, Ship, Scale AI Applications

huangapple
  • 本文由 发表于 2023年5月6日 16:09:39
  • 转载请务必保留本文链接:https://go.coder-hub.com/76187823.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定