Combining Golang and Python for ML-based API?

polaris · 2017-02-23 10:00:20 · 548 次点击    
这是一个分享于 2017-02-23 10:00:20 的资源,其中的信息可能已经有所发展或是发生改变。

I came from Python where there are a lot of stuffs in Machine Learning. There are some alternatives for ML in golang, but they do not seem to meet my demand. Is there anyway that I can build an API in golang that take advantages from ML codes that are written in Python?


评论:

chewxy:

You can use zmq/grpc + protobuf/flatbufs to call python code. I do that, but increasingly I am replacing most of my ML stuff with Go

Also, I'm curious as to what is your demand that you can't do with Go

Sythe2o0:

I assume they want to link into something like TensorFlow through python.

HectorJ:

TensorFlow has a Go lib: https://github.com/tensorflow/tensorflow/tree/master/tensorflow/go

(haven't tested it yet though)

chewxy:

Ah there is Gorgonia which is the equivalent of TF in Go... I've been using it for years in replacement for TF/Theano. No complaints yet.

bobbafeftta:

you could use go to call python directly, interacting via STDIO

see: http://stackoverflow.com/questions/19397986/calling-python-function-from-go-and-getting-the-function-return-value

alternatively you could look into: https://github.com/sbinet/go-python

BOSS_OF_THE_INTERNET:

Google has Grumpy. Not sure how robust it is regarding third party libs, but it might be worth a look.

https://github.com/google/grumpy

cristianchaparroa:

you can create micro services with go using micro (go-micro) and use sidecar with python and go, for communicate the both. https://micro.mu/ https://github.com/micro/micro https://github.com/micro/micro/tree/master/car


入群交流(和以上内容无关):加入Go大咖交流群,或添加微信:liuxiaoyan-s 备注:入群;或加QQ群:692541889

548 次点击  
加入收藏 微博
暂无回复
添加一条新回复 (您需要 登录 后才能回复 没有账号 ?)
  • 请尽量让自己的回复能够对别人有帮助
  • 支持 Markdown 格式, **粗体**、~~删除线~~、`单行代码`
  • 支持 @ 本站用户;支持表情(输入 : 提示),见 Emoji cheat sheet
  • 图片支持拖拽、截图粘贴等方式上传