You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Golang Tensorflow API cannot be build any more #23257
OS Platform and Distribution (e.g., Linux Ubuntu 16.04): Linux
TensorFlow version: 1.10.1, 1.11.0, 1.12.0-rc1
Only tested CPU version
Describe the problem
I tried to build my golang project which uses the tensorflow Go API. The CI build in Gitlab failed without a change (also old builds, which finished successfully before, cannot be build any more).
I run the following commands:
curl --silent -L "https://storage.googleapis.com/tensorflow/libtensorflow/libtensorflow-cpu-linux-x86_64-1.12.0-rc1.tar.gz" | tar -C /usr/local -xz
ldconfig
go get github.com/tensorflow/tensorflow/tensorflow/go
Then I receive the following error:
# github.com/tensorflow/tensorflow/tensorflow/go
/tmp/go-build813894416/b001/_x003.o: In function `_cgo_691d94bb61b7_Cfunc_TF_ImportGraphDefOptionsSetDefaultDevice':
/tmp/go-build/cgo-gcc-prolog:198: undefined reference to `TF_ImportGraphDefOptionsSetDefaultDevice'
collect2: error: ld returned 1 exit status
This did not happend before with the exact same commands. It also happens if I use other versions of the C library. Therefore I assume that the tensorflow Go API is broken in the current master.
I'm having the same issue building tensorflow GO API. I first tried it on my macOS, to receive the following error
github.com/tensorflow/tensorflow/tensorflow/go
# github.com/tensorflow/tensorflow/tensorflow/go
Undefined symbols for architecture x86_64:
"_TF_ImportGraphDefOptionsSetDefaultDevice", referenced from:
__cgo_9c811c796559_Cfunc_TF_ImportGraphDefOptionsSetDefaultDevice in _x003.o
(maybe you meant: __cgo_9c811c796559_Cfunc_TF_ImportGraphDefOptionsSetDefaultDevice)
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
Then, in order to isolate from issues arising due to linking issues on my personal dev env, I ran the above in a docker container and got the error
github.com/tensorflow/tensorflow (download)
github.com/tensorflow/tensorflow/tensorflow/go
# github.com/tensorflow/tensorflow/tensorflow/go
/tmp/go-build042240265/b001/_x003.o: In function `_cgo_691d94bb61b7_Cfunc_TF_ImportGraphDefOptionsSetDefaultDevice':
/tmp/go-build/cgo-gcc-prolog:198: undefined reference to `TF_ImportGraphDefOptionsSetDefaultDevice'
collect2: error: ld returned 1 exit status
Same problem here. I can not download the go package from the github. :(
package github.com/tensorflow/tensorflow/tensorflow/go: exit status 128 package github.com/tensorflow/tensorflow/tensorflow/go/op: cannot find package "github.com/tensorflow/tensorflow/tensorflow/go/op" in any of:
@andreas-eberle @bearbite : This is because the code in the Go library for the "master" branch depends on the C library (libtensorflow.so) built from the master branch. Since the C library being used is from the 1.10/1.11/1.12 release, you'd have to checkout the corresponding branch.
This is similar to: #14546 (comment), where you'd want to do something like:
@asimshankar: This definitely has to be documented better. When I follow the official installation instructions, I cannot build the tensorflow Go API. Maybe consider changing the installation instructions to use a dependecy management like Go Dep. With that you can easily specify the version you'd like to build.
I also interested to see correct set of instructions. So far everything was "trivial" we call go get and get the build. Now it seems the orchestration should be done with git, versions, branches.
go test github.com/tensorflow/tensorflow/tensorflow/go
github.com/tensorflow/tensorflow/tensorflow/go
/usr/bin/ld: $WORK/b048/_x003.o: in function _cgo_9c811c796559_Cfunc_TF_ImportGraphDefOptionsSetDefaultDevice': /tmp/go-build/cgo-gcc-prolog:204: undefined reference to TF_ImportGraphDefOptionsSetDefaultDevice'
collect2: error: ld returned 1 exit status
FAIL github.com/tensorflow/tensorflow/tensorflow/go [build failed]
#35133
not exactly the same issue. But the same part is that installing tensorflow go failed when there is a update. There should be an integration test here.
Activity
arushijain commentedon Oct 26, 2018
Just to give more information on this
I'm having the same issue building tensorflow GO API. I first tried it on my macOS, to receive the following error
Then, in order to isolate from issues arising due to linking issues on my personal dev env, I ran the above in a docker container and got the error
Same issue, AFAICT.
bearbite commentedon Oct 27, 2018
Same problem here. I can not download the go package from the github. :(
package github.com/tensorflow/tensorflow/tensorflow/go: exit status 128 package github.com/tensorflow/tensorflow/tensorflow/go/op: cannot find package "github.com/tensorflow/tensorflow/tensorflow/go/op" in any of:asimshankar commentedon Oct 28, 2018
@andreas-eberle @bearbite : This is because the code in the Go library for the "master" branch depends on the C library (
libtensorflow.so) built from the master branch. Since the C library being used is from the 1.10/1.11/1.12 release, you'd have to checkout the corresponding branch.This is similar to: #14546 (comment), where you'd want to do something like:
I'll keep this issue open because this seems like something that we should at least document better in the installation instructions.
andreas-repp commentedon Oct 29, 2018
@asimshankar: This definitely has to be documented better. When I follow the official installation instructions, I cannot build the tensorflow Go API. Maybe consider changing the installation instructions to use a dependecy management like Go Dep. With that you can easily specify the version you'd like to build.
Trying to fix build, issue tensorflow/tensorflow#23257
vkuznet commentedon Oct 29, 2018
I also interested to see correct set of instructions. So far everything was "trivial" we call go get and get the build. Now it seems the orchestration should be done with git, versions, branches.
Trying to fix build, issue tensorflow/tensorflow#23257
Trying to fix build, issue tensorflow/tensorflow#23257
asimshankar commentedon Oct 29, 2018
To be clear, yes we want things to be easy.
My comments abive were meant as an explanation and a suggested workaround.
I will have to look into the appropriate fix
freecaykes commentedon Nov 4, 2018
@asimshankar is it beneficial to mention this issue on this page for the mean time until the complete fix
https://www.tensorflow.org/install/lang_go
I was recently installing and found this issue page to be really useful
tensorflowbutler commentedon Nov 20, 2018
Nagging Assignee @asimshankar: It has been 15 days with no activity and this issue has an assignee. Please update the label and/or status accordingly.
fardok commentedon Nov 21, 2018
have the same problem installing go
fardok commentedon Nov 21, 2018
anybody test the older version? maybe better use https://storage.googleapis.com/tensorflow/libtensorflow/libtensorflow-cpu-linux-x86_64-1.3.0.tar.gz ?
fardok commentedon Nov 21, 2018
test with old version:
#include <stdio.h>
#include <tensorflow/c/c_api.h>
int main() {
printf("Hello from TensorFlow C library version %s\n", TF_Version());
return 0;
}
also return error:
sudo gcc test.c -o hello
/usr/bin/ld: /tmp/ccJT12Vj.o: in function
main': test.c:(.text+0xa): undefined reference toTF_Version'collect2: error: ld returned 1 exit status
fardok commentedon Nov 21, 2018
g++ -I/usr/local/include -L/usr/local/lib test.c -ltensorflow
work fine 👍
freemanliu commentedon Dec 18, 2019
#35133
not exactly the same issue. But the same part is that installing tensorflow go failed when there is a update. There should be an integration test here.