Code Monkey home page Code Monkey logo

Comments (1)

galeone avatar galeone commented on August 20, 2024

Because tfgo uses the official TensorFlow''s Go bindings under the hood (a fork I created because these bindings are not go-gettable) and these bindings do not support tf.Variable.

The Go bindings are almost abandoned, just think about that we are constrained to the static graph + session execution (without tf.Variable support, for using them you have to define the model in Python as a SavedModel and then load it in tfgo) while the C API has the support for the Eager Execution and creating variables on the fly.

For adding the support for tf.Variable the only possible way is to write in my fork ( https://github.com/galeone/tensorflow ) the tf.Variable support in C, and expose them in Go via cgo.

But it's not worth it IMO since the support for static-graph + session execution is enough for every application: just write the graph in Python (a function decorated with @tf.function) and export it as a SavedModel - the graph can contain any layer, with variables and so on. The exported graph can be loaded into tfgo and used, being the state (the value of the variables) managed by the TensorFlow runtime (the C library) and not by the bindings.

What it would be worth doing, instead, is exposing all the new eager C API to the Go bindings (my fork) - but that's a lot of work and people at Google are not doing it, hence I suppose it's something not trivial

from tfgo.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.