Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

客户端问题 #5

Open
JinYiGao opened this issue Oct 24, 2020 · 4 comments
Open

客户端问题 #5

JinYiGao opened this issue Oct 24, 2020 · 4 comments

Comments

@JinYiGao
Copy link

这个项目我整个都跑通了,但是客户端是Java程序,我想做一个网页进行线上推理服务,有什么比较好的思路吗?或者说客户端应该怎么改?

@fengyu10
Copy link
Contributor

  1. grpc协议是支持跨语言的,客户端可以使用其他语言来开发,grpc支持语言有C#、C++、Go、Java、Node、php和Python等
  2. 如果使用其他语言来开发客户端麻烦,可以将dl_inference/DLPredictOnline/dlpredictonline/改造成http服务,前端请求dlpredictonline http服务,由dlpredictonline服务请求后端模型

@JinYiGao
Copy link
Author

JinYiGao commented Nov 8, 2020

我目前打算采用nodejs来实现客户端,统一接入服务中predict函数的传入参数是PredictRequest类型的:
image
那我在js中调用grpc的时候应该怎么传参呢?前后端能响应了 但就是参数貌似不对 在js中我应该怎么构造参数?

@JinYiGao
Copy link
Author

JinYiGao commented Nov 8, 2020

初学者 有很多地方可能不是很明白 还望多指教。。。

@fengyu10
Copy link
Contributor

Predict.PredictRequest 对象为Tensorflow-Serving官方proto文件编译出来的java对象,proto文件:https://github.com/tensorflow/serving/blob/master/tensorflow_serving/apis/predict.proto

  1. 优先考虑js是否支持grpc,支持可将proto文件编译为js对象,直接传输此对象即可
  2. 若不支持,可以考虑后端开发服务做中转,js直接传输数据到后端java服务,后端java服务再调用dl_inference接口

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants