Tensorflow train in Go Serve in Go

215 views
Skip to first unread message

luce...@gmail.com

unread,
Dec 30, 2017, 2:40:34 AM12/30/17
to Discuss
  
 When can we expect Tensorflow Training in Go and Serve in Go to get rid of Python?

Martin Wicke

unread,
Dec 30, 2017, 1:17:53 PM12/30/17
to luce...@gmail.com, Jonathan Hseu, Asim Shankar, Discuss
+Jonathan, Asim

There are go bindings, Jonathan or Asim can speak to how complete they are. 

Martin

On Fri, Dec 29, 2017 at 11:40 PM, <luce...@gmail.com> wrote:
  
 When can we expect Tensorflow Training in Go and Serve in Go to get rid of Python?

--
You received this message because you are subscribed to the Google Groups "Discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to discuss+unsubscribe@tensorflow.org.
To post to this group, send email to dis...@tensorflow.org.
To view this discussion on the web visit https://groups.google.com/a/tensorflow.org/d/msgid/discuss/be8be216-c3e9-4972-a979-9cc346178038%40tensorflow.org.

Asim Shankar

unread,
Dec 30, 2017, 10:36:08 PM12/30/17
to Martin Wicke, luce...@gmail.com, Jonathan Hseu, Discuss
It technically is possible to do everything in Go.
In practice (both in terms of convenience APIs and documentation), I'd say that:
- Serving models should be reasonably convenient today (and does not require Python)
- Training models is a little less so, but not too out of whack (and does not require Python)
- Constructing models is not convenient at all. Thus, model construction is probably still best in Python and there are no short term plans to changer that.


More detail:
(a) "Serving": - ideally SavedModel, but even a GraphDef - via Go should be reasonably practical today. For exmaple, see this recent blog post: https://blog.gopheracademy.com/advent-2017/tensorflow-and-go/. It should also be easy to communicate with models hosted by a TensorFlow Serving server since that is just a gRPC service which does have Go support. No dependency on Python here.

(b) "Training": A training loop typically involves running the "train_op" in the graph and then periodically operations to save checkpoints or summaries. The API is a bit lower level that the convenience offered by the Python Estimator API, but not terribly out of whack I think. For example, see https://github.com/asimshankar/go-tensorflow/tree/master/train. Again, the program that trains the model has no dependency on Python. Thus, for example, model parameters can be updated by your Go application. Caveat: I'm speaking of single machine (possibly with multiple GPUs) here. Distributed training across processes is another story.

(c) "Building" models, i.e., constructing the graph. In theory this is also possible in Go since there are Go functions for every TensorFlow operation (https://godoc.org/github.com/tensorflow/tensorflow/tensorflow/go/op). However, except for very simple graphs one will very soon begin to miss the higher level constructs like Variables, Optimizers, Layers etc. in the Python API. The net result is that it is possible to build higher level APIs in Go, but as of this time the TensorFlow maintainers have not prioritized it. We encourage the opensource community to build their own higher level Go libraries.

Hope this was helpful and somewhat answers your question.
We certainly appreciate feedback, comments, bugs, feature requests etc on this on Github.
We may seek community involvement in addressing some of those though.

Looking forward to your comments,
Thanks,

-- Asim




On Sat, Dec 30, 2017 at 10:17 AM Martin Wicke <wi...@google.com> wrote:
+Jonathan, Asim

There are go bindings, Jonathan or Asim can speak to how complete they are. 

Martin
On Fri, Dec 29, 2017 at 11:40 PM, <luce...@gmail.com> wrote:
  
 When can we expect Tensorflow Training in Go and Serve in Go to get rid of Python?

--
You received this message because you are subscribed to the Google Groups "Discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to discuss+u...@tensorflow.org.

Zero Chen

unread,
Dec 31, 2017, 11:09:08 AM12/31/17
to Asim Shankar, Martin Wicke, luce...@gmail.com, Jonathan Hseu, Discuss
> Looking forward to your comments,

If people don't mind building GraphDef in python, that is fine. But people still can't "get rid of Python".

Building a complicated GraphDefin other languages is still difficult.

--
cg

 

To unsubscribe from this group and stop receiving emails from it, send an email to discuss+unsubscribe@tensorflow.org.

--
You received this message because you are subscribed to the Google Groups "Discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to discuss+unsubscribe@tensorflow.org.

To post to this group, send email to dis...@tensorflow.org.
Reply all
Reply to author
Forward
0 new messages