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

support for Tensorflow 2 #35

Closed
Arnold1 opened this issue May 29, 2020 · 4 comments · Fixed by #36
Closed

support for Tensorflow 2 #35

Arnold1 opened this issue May 29, 2020 · 4 comments · Fixed by #36
Assignees

Comments

@Arnold1
Copy link

Arnold1 commented May 29, 2020

hi,

it seems tensorflow 2.2.0 for golang got released: https://pkg.go.dev/github.com/tensorflow/tensorflow/tensorflow/go?tab=doc

Are you going to support it?

but Tensorflow C api is still 1.15: https://www.tensorflow.org/install/lang_c

@galeone
Copy link
Owner

galeone commented May 29, 2020

tfgo already works with TensorFlow 2.x if you compile the C library by yourself, it's just a matter of linking it.

Officially I can't support it, because I have to wait for the official C library compiled. But as soon as it's out I will support it.

In the meantime, you can compile the C library by yourself (or, if like me you use Archlinux you can just install the tensorflow package and link with the ready-to-use .so) and use tfgo with the tf 2.x runtime.

@mxk
Copy link

mxk commented Oct 5, 2020

Official libs have been updated: https://www.tensorflow.org/install/lang_c

@galeone
Copy link
Owner

galeone commented Nov 1, 2020

@mxk @Arnold1 sorry for the extreme delay (but lockdown + moving to a new apartment have absorbed all my time).

I'll have a look at TensorFlow 2.x support (I'll start with TensorFlow 2.3.1).
In order to be able to completely support it, I also have to rewrite the test part of tfgo (I use a Python script to generate a tensorflow 1.x support - now, instead, I have to export a tensorflow 2.x function (or model, or stati graph) using tf.function.

It won't be immediate, but perhaps if I find the time, in some weeks a new release should be available.

P.S: I covered the tf.function export + the load in tfgo in my book (https://amzn.to/2TMImSw) if you're interested, you can have a look at the last paragraph.

@galeone galeone self-assigned this Nov 1, 2020
@galeone galeone linked a pull request Nov 1, 2020 that will close this issue
@galeone
Copy link
Owner

galeone commented Nov 10, 2020

I merged the support for TensorFlow 2.x (in particular, 2.3.1).

I had to remove the estimator support because TensorFlow is almost dropping them and are impossible to maintain alone.

Moreover, I had to create a TensorFlow fork with some fix in the tests and with all the required .proto files compiled and placed in the correct position, in this way it's easy to go build and also go get the package without any compilation error.

I updated the README accordingly

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

Successfully merging a pull request may close this issue.

3 participants