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

Go installation error #43847

Closed
fedyfausto opened this issue Oct 7, 2020 · 27 comments
Closed

Go installation error #43847

fedyfausto opened this issue Oct 7, 2020 · 27 comments
Assignees
Labels
stale This label marks the issue/pr stale - to be closed automatically if no activity stat:awaiting response Status - Awaiting response from author stat:awaiting tensorflower Status - Awaiting response from tensorflower subtype: ubuntu/linux Ubuntu/Linux Build/Installation Issues TF 2.3 Issues related to TF 2.3 type:build/install Build and install issues

Comments

@fedyfausto
Copy link

fedyfausto commented Oct 7, 2020

System information

  • OS Platform and Distribution (e.g., Linux Ubuntu 16.04): Fedora 32
  • TensorFlow installed from (source or binary): binary
  • TensorFlow version: 2.3.0
  • Python version:3.8.5
  • Installed using virtualenv? pip? conda?: pip
  • CUDA/cuDNN version: 11.0
  • GPU model and memory: 1660 gtx super (6GB)
  • GO version: 1.15.2

Hello i'm trying to install the tensorflow go version to build a little application. So i installed the C library (2.3.0 version tested with classic hello.c example) and after that i run the following command:

go get github.com/tensorflow/tensorflow/tensorflow/go

but after this one i get this error:

go: found github.com/tensorflow/tensorflow/tensorflow/go in github.com/tensorflow/tensorflow v2.3.1+incompatible
go: finding module for package github.com/tensorflow/tensorflow/tensorflow/go/core/protobuf/for_core_protos_go_proto
go: finding module for package github.com/tensorflow/tensorflow/tensorflow/go/core/protobuf/for_core_protos_go_proto
../../../../golang/gopath/pkg/mod/github.com/tensorflow/tensorflow@v2.3.1+incompatible/tensorflow/go/saved_model.go:25:2: module github.com/tensorflow/tensorflow@latest found (v2.3.1+incompatible), but does not contain package github.com/tensorflow/tensorflow/tensorflow/go/core/protobuf/for_core_protos_go_proto

could tou help me?

Go ENVS:

GO111MODULE="on"
GOARCH="amd64"
GOBIN=""
GOCACHE="/home/fedyfausto/.cache/go-build"
GOENV="/home/fedyfausto/.config/go/env"
GOEXE=""
GOFLAGS=""
GOHOSTARCH="amd64"
GOHOSTOS="linux"
GOINSECURE=""
GOMODCACHE="/home/fedyfausto/golang/gopath/pkg/mod"
GONOPROXY=""
GONOSUMDB=""
GOOS="linux"
GOPATH="/home/fedyfausto/golang/gopath"
GOPRIVATE=""
GOPROXY="https://proxy.golang.org,direct"
GOROOT="/home/fedyfausto/golang/latest/go"
GOSUMDB="sum.golang.org"
GOTMPDIR=""
GOTOOLDIR="/home/fedyfausto/golang/latest/go/pkg/tool/linux_amd64"
GCCGO="gccgo"
AR="ar"
CC="gcc"
CXX="g++"
CGO_ENABLED="1"
GOMOD="/home/fedyfausto/Lavoro/Project/go_predictor_2/project_name/go.mod"
CGO_CFLAGS="-g -O2"
CGO_CPPFLAGS=""
CGO_CXXFLAGS="-g -O2"
CGO_FFLAGS="-g -O2"
CGO_LDFLAGS="-g -O2"
PKG_CONFIG="pkg-config"
GOGCCFLAGS="-fPIC -m64 -pthread -fmessage-length=0 -fdebug-prefix-map=/tmp/go-build398631669=/tmp/go-build -gno-record-gcc-switches"
@fedyfausto fedyfausto added the type:build/install Build and install issues label Oct 7, 2020
@Saduf2019 Saduf2019 added the TF 2.3 Issues related to TF 2.3 label Oct 7, 2020
@Saduf2019
Copy link
Contributor

@fedyfausto
Please refer to this issue with same error and let us know :#41808 #34580 #39307

@Saduf2019 Saduf2019 added the stat:awaiting response Status - Awaiting response from author label Oct 7, 2020
@fedyfausto
Copy link
Author

fedyfausto commented Oct 7, 2020

The issue is same but seems does not be resolved yet

@fedyfausto
Copy link
Author

i tryied to re-install all but seems some files miss (the file for_core_protos_go_proto)

@fedyfausto
Copy link
Author

The C library seems work:

[fedyfausto@desktop-fisso-fedyfausto-fedora Scrivania]$ gcc hello_tf.c -ltensorflow -o hello_tf
/usr/bin/ld: /usr/local/lib/libtensorflow.so: .dynsym local symbol at index 851 (>= sh_info of 2)
/usr/bin/ld: /usr/local/lib/libtensorflow.so: .dynsym local symbol at index 1959 (>= sh_info of 2)
/usr/bin/ld: /usr/local/lib/libtensorflow.so: .dynsym local symbol at index 2329 (>= sh_info of 2)
/usr/bin/ld: /usr/local/lib/libtensorflow.so: .dynsym local symbol at index 2517 (>= sh_info of 2)
/usr/bin/ld: /usr/local/lib/libtensorflow.so: .dynsym local symbol at index 2732 (>= sh_info of 2)
/usr/bin/ld: /usr/local/lib/libtensorflow.so: .dynsym local symbol at index 2733 (>= sh_info of 2)
[fedyfausto@desktop-fisso-fedyfausto-fedora Scrivania]$ ./hello_tf 
Hello from TensorFlow C library version 2.3.0

@Saduf2019
Copy link
Contributor

The C library seems work:

[fedyfausto@desktop-fisso-fedyfausto-fedora Scrivania]$ gcc hello_tf.c -ltensorflow -o hello_tf
/usr/bin/ld: /usr/local/lib/libtensorflow.so: .dynsym local symbol at index 851 (>= sh_info of 2)
/usr/bin/ld: /usr/local/lib/libtensorflow.so: .dynsym local symbol at index 1959 (>= sh_info of 2)
/usr/bin/ld: /usr/local/lib/libtensorflow.so: .dynsym local symbol at index 2329 (>= sh_info of 2)
/usr/bin/ld: /usr/local/lib/libtensorflow.so: .dynsym local symbol at index 2517 (>= sh_info of 2)
/usr/bin/ld: /usr/local/lib/libtensorflow.so: .dynsym local symbol at index 2732 (>= sh_info of 2)
/usr/bin/ld: /usr/local/lib/libtensorflow.so: .dynsym local symbol at index 2733 (>= sh_info of 2)
[fedyfausto@desktop-fisso-fedyfausto-fedora Scrivania]$ ./hello_tf 
Hello from TensorFlow C library version 2.3.0

Do you mean the issue is resolved.

@tensorflowbutler tensorflowbutler removed the stat:awaiting response Status - Awaiting response from author label Oct 11, 2020
@ddumbugie
Copy link

@Saduf2019 I've met same problem, too.

The C library of v2.3.0 works well.

Go version of tensorflow@v2.3.0 or v2.3.1 does not work in go mod environment.

@quenbyako
Copy link

quenbyako commented Oct 14, 2020

Same problem.

OS ubuntu/amd64
Tensorflow v2.3.1
Golang v1.15.1

This issue is STILL NOT SOLVED. All of us can't say that this trouble is fixed until this guide will be done step by step without any errors or warnings.

@Saduf2019

@quenbyako
Copy link

@advaitjain @gunan @hawkinsp @qlzh727 anyone?

@gunan
Copy link
Contributor

gunan commented Oct 14, 2020

@jhseu may be able to help, I do not think anyone else investigated go packages.

@quenbyako
Copy link

fuck, i accidentally delete /usr/local cause i tried to solve this issue by the hands, lol 😆 😆 😆. Thanks nvidia and tensorflow developers to create simple deb packages that are "just works"

@shravanshetty1
Copy link

Having the same issue as op

@Saduf2019 Saduf2019 added the subtype: ubuntu/linux Ubuntu/Linux Build/Installation Issues label Oct 15, 2020
@Saduf2019 Saduf2019 assigned gowthamkpr and unassigned Saduf2019 Oct 15, 2020
@kep-w
Copy link

kep-w commented Oct 19, 2020

Having the same issue, after go generate github.com/tensorflow/tensorflow/tensorflow/go/op
cannot find package "github.com/tensorflow/tensorflow/tensorflow/go/core/protobuf/for_core_protos_go_proto" in any of:
${GOPATH}/src/github.com/tensorflow/tensorflow/tensorflow/go/vendor/github.com/tensorflow/tensorflow/tensorflow/go/core/protobuf/for_core_protos_go_proto (vendor tree)
/usr/local/Cellar/go/1.15/libexec/src/github.com/tensorflow/tensorflow/tensorflow/go/core/protobuf/for_core_protos_go_proto (from $GOROOT)
${GOPATH}/src/github.com/tensorflow/tensorflow/tensorflow/go/core/protobuf/for_core_protos_go_proto (from $GOPATH)
In the core dir only two dirs:
core_protos_go_proto
framework

@quenbyako
Copy link

@fedyfausto @Saduf2019 @gowthamkpr have you found any solutions?

Perhaps, we need to create custom bindings for tensorflow, cuz usually google fixing their bugs to much time.

@fedyfausto
Copy link
Author

After a lot of try and errors i finally found a little solution:
I installed the last version of TensorFlow C library (2.30.) from BINARY. After that i installed the GO VERSION of tensorflow 2.1.0 and it seems work, so there is some bug in 2.3.0 of go version (anyway the go runs 2.3.0 c libray so it is fine).

Now i'm facing to another problem, how could i compile a single solution within tensorflow library to distribuite the final solution?

@quenbyako
Copy link

@fedyfausto i could cooperate with you to fix this problem (cuz i realy need working ml framework on go), so if yo want, text me on email or telegram, links in my profile.

@fedyfausto
Copy link
Author

fedyfausto commented Oct 20, 2020 via email

@kep-w
Copy link

kep-w commented Oct 29, 2020

I solved this problem by changing the TensorFlow version to 1.13.
Download the corresponding version of TensorFlow, and then go generate $GOPATH/src/......
At the same time, you need to modify the tensorflow version of require in go.mod
require github.com/tensorflow/tensorflow v1.13.2

@gowthamkpr gowthamkpr assigned perfinion and unassigned gowthamkpr Oct 30, 2020
@gowthamkpr gowthamkpr added the stat:awaiting tensorflower Status - Awaiting response from tensorflower label Oct 30, 2020
@quenbyako
Copy link

@kep-w all participants here are already decided that tensorflow 1.13 is works well, but latest version is v2.3.1!!! Also, 2.* versions are mentioned in official guide, so this is not a solution actually.

@wamuir
Copy link
Contributor

wamuir commented Nov 12, 2020

@fedyfausto @ololosha228 @kep-w @shravanshetty1

I've placed a working Dockerfile for Go 1.15 and TensorFlow 2.3.1 at https://github.com/wamuir/golang-tf . I hope this helps.

@quenbyako
Copy link

@wamuir thanks a lot! i'll try to experiment with your image, and leave a feedback in your repo (or here, idk)

@Saduf2019
Copy link
Contributor

@fedyfausto
Do you still face the issue, could you please try with the latest tf version and update us.

@Saduf2019 Saduf2019 added the stat:awaiting response Status - Awaiting response from author label Jul 27, 2021
@ptxmac
Copy link

ptxmac commented Jul 29, 2021

Yes this is still a problem. tensorflow/go can only be used with bazel, or by building a local version and putting it in vendor.

For anyone else struck here, @galeone is maintaining a fork with the propobuf files compiled: https://github.com/galeone/tensorflow (He also have a wrapper for making it even easier to use tensorflow in go: https://github.com/galeone/tfgo )

@quenbyako
Copy link

quenbyako commented Aug 2, 2021

@Saduf2019 i copy that, tried to rerun "getting started" guide to install and use tensorflow in go, and still lots a lot of problems

To be honest, i prefer to recommend any user who read this comment, use @galeone packages cause... Well, they work, at least...

@wamuir
Copy link
Contributor

wamuir commented Aug 2, 2021

Here's a summary for anyone who wants this summarized: you cannot use go get to obtain a functional copy of github.com/tensorflow/tensorflow/tensorflow/go. This is because the package relies on compiled protocol buffers, but compiled protobufs cannot be checked into this git repo (see #44655). Previously, it was fairly straightforward to obtain a working installation by cloning the Tensorflow repo into ${GOPATH}/src and then using go generate to compile the buffers, but recent Go module changes and the deprecation of GOPATH have all but made this approach impossible (despite what the Install Guide in this repo would have you believe!).

Things that flat out won't work:

  1. Using go get github.com/tensorflow/tensorflow/tensorflow/go
  2. Following the current installation guide in this repo, which needs an update

You can still use tensorflow/go. A few solutions that may work for you:

  1. Clone the Tensorflow repo, generate the protocol buffers locally and then use go mod's replace directive: instructions are in SIG Build's Golang Install Guide
  2. Switch to a fork that includes the generated protocol buffers, such as https://github.com/galeone/tensorflow from @galeone
  3. Use Docker images that have Go, the TF shared libs and tensorflow/go installed, such as https://github.com/wamuir/golang-tf
  4. Soon, hopefully, build with Bazel; a PR is at [Go] add bazel rules #50934

@google-ml-butler
Copy link

This issue has been automatically marked as stale because it has no recent activity. It will be closed if no further activity occurs. Thank you.

@google-ml-butler google-ml-butler bot added the stale This label marks the issue/pr stale - to be closed automatically if no activity label Aug 9, 2021
@google-ml-butler
Copy link

Closing as stale. Please reopen if you'd like to work on this further.

@google-ml-butler
Copy link

Are you satisfied with the resolution of your issue?
Yes
No

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
stale This label marks the issue/pr stale - to be closed automatically if no activity stat:awaiting response Status - Awaiting response from author stat:awaiting tensorflower Status - Awaiting response from tensorflower subtype: ubuntu/linux Ubuntu/Linux Build/Installation Issues TF 2.3 Issues related to TF 2.3 type:build/install Build and install issues
Projects
None yet
Development

No branches or pull requests