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

installation issue: can't find for_core_protos_go_proto #46

Open
true-zero opened this issue Feb 7, 2021 · 14 comments
Open

installation issue: can't find for_core_protos_go_proto #46

true-zero opened this issue Feb 7, 2021 · 14 comments

Comments

@true-zero
Copy link

I'm opening up a new issue since none of the solutions given in the original issue fix the problem at all.

C:\Users\User\go\src\testTensor>go get github.com/galeone/tfgo
package github.com/tensorflow/tensorflow/tensorflow/go/core/protobuf/for_core_protos_go_proto: cannot find package "github.com/tensorflow/tensorflow/tensorflow/go/core/protobuf/for_core_protos_go_proto" in any
of:
        C:\Go\src\github.com\tensorflow\tensorflow\tensorflow\go\core\protobuf\for_core_protos_go_proto (from $GOROOT)
        C:\Users\User\go\src\github.com\tensorflow\tensorflow\tensorflow\go\core\protobuf\for_core_protos_go_proto (from $GOPATH)

I am attempting to be able to run this code, but this repository in it's current state is completely uninstallable.

@true-zero
Copy link
Author

Initialised go mod which seemed to help with the issue but then created a different issue with gcc.

C:\Users\User\go\src\testTensor>go mod init
go: creating new go.mod: module testTensor

C:\Users\User\go\src\testTensor>go get github.com/galeone/tfgo
go: github.com/galeone/tfgo upgrade => v0.0.0-20210204182614-84b9a5e77f79
go: downloading github.com/galeone/tensorflow v2.4.0-rc0.0.20210202175351-640a390c2283+incompatible
go: downloading github.com/golang/protobuf v1.4.3
go: downloading google.golang.org/protobuf v1.25.0
# github.com/galeone/tensorflow/tensorflow/go
exec: "gcc": executable file not found in %PATH%

@true-zero
Copy link
Author

After spending time installing MingGW and adding it to the PATH for system.

C:\Users\User\go\src\testTensor>go get github.com/galeone/tfgo
# github.com/galeone/tensorflow/tensorflow/go
C:/MinGW/bin/../lib/gcc/x86_64-w64-mingw32/8.1.0/../../../../x86_64-w64-mingw32/bin/ld.exe: cannot find -ltensorflow
collect2.exe: error: ld returned 1 exit status

@true-zero
Copy link
Author

According to the official documentation Go bindings for Tensorflow is not supported on Windows systems however according to this comment with a bit of hacking together it may be possible to get it to work.

@galeone
Copy link
Owner

galeone commented Feb 10, 2021

Really sorry but I'm not able to help you, I don't have a windows machine 😅

I'd keep this issue open hoping for someone in the same situation that might be able to solve this. Or maybe, if you'll be able to make it work on windows you could open a pull request even to describe the step-by-step process, it would be really appreciated

@vkuznet
Copy link

vkuznet commented Apr 3, 2021

Hi,
how about macOS? I have the following problem:

# I tried with and without
# go env -w GONOSUMDB="github.com/galeone/tensorflow"

go get github.com/galeone/tfgo
go: downloading github.com/galeone/tfgo v0.0.0-20210204182614-84b9a5e77f79
go: downloading github.com/galeone/tensorflow v2.4.0-rc0.0.20210202175351-640a390c2283+incompatible
# github.com/galeone/tensorflow/tensorflow/go
Undefined symbols for architecture x86_64:
  "_TFE_ContextOptionsSetAsync", referenced from:
      __cgo_3a1240f23db5_Cfunc_TFE_ContextOptionsSetAsync in _x003.o
     (maybe you meant: __cgo_3a1240f23db5_Cfunc_TFE_ContextOptionsSetAsync)
  "_TF_AddGradientsWithPrefix", referenced from:
      __cgo_3a1240f23db5_Cfunc_TF_AddGradientsWithPrefix in _x004.o
     (maybe you meant: __cgo_3a1240f23db5_Cfunc_TF_AddGradientsWithPrefix)
  "_TF_ImportGraphDefOptionsSetDefaultDevice", referenced from:
      __cgo_3a1240f23db5_Cfunc_TF_ImportGraphDefOptionsSetDefaultDevice in _x004.o
     (maybe you meant: __cgo_3a1240f23db5_Cfunc_TF_ImportGraphDefOptionsSetDefaultDevice)
  "_TF_TensorBitcastFrom", referenced from:
      __cgo_3a1240f23db5_Cfunc_TF_TensorBitcastFrom in _x011.o
     (maybe you meant: __cgo_3a1240f23db5_Cfunc_TF_TensorBitcastFrom)
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)

@galeone
Copy link
Owner

galeone commented Apr 3, 2021

Hi @vkuznet , have you downloaded and installed in your system the correct library? https://storage.googleapis.com/tensorflow/libtensorflow/libtensorflow-cpu-darwin-x86_64-2.4.0.tar.gz

I don't have a Mac so I can't help you trying to reproduce your issue on my computer, but It looks like some symbol is missing from the library.

Have you tried to follow the steps suggested in the tensorflow install c documentation and run the hello world in C? Does it work?

@vkuznet
Copy link

vkuznet commented Apr 3, 2021

After several iterations I found the issue. Turns out I had in /usr/local/lib previous version of TF (1.X) I was need to remove it, then I copied TF 2.4 library to /usr/local/lib and after that I was able to get tfgo. Now it seems to work

@galeone
Copy link
Owner

galeone commented Apr 3, 2021

After several iterations I found the issue. Turns out I had in /usr/local/lib previous version of TF (1.X) I was need to remove it, then I copied TF 2.4 library to /usr/local/lib and after that I was able to get tfgo. Now it seems to work

Great! Thank you for this update. Now I know that tfgo also runs on MacOS then :)

@farshed
Copy link

farshed commented Oct 20, 2021

Hi @galeone, is there a way to use it on mac arm64. It gives me the following error when I try to install.

ld: warning: ignoring file /usr/local/lib/libtensorflow.dylib, building for macOS-arm64 but attempting to link with file built for macOS-x86_64
Undefined symbols for architecture arm64:
"_TFE_ContextListDevices", referenced from:
__cgo_54a25ea29f0c_Cfunc_TFE_ContextListDevices in _x003.o
(maybe you meant: __cgo_54a25ea29f0c_Cfunc_TFE_ContextListDevices)
"_TFE_ContextOptionsSetAsync", referenced from:
__cgo_54a25ea29f0c_Cfunc_TFE_ContextOptionsSetAsync in _x003.o
(maybe you meant: __cgo_54a25ea29f0c_Cfunc_TFE_ContextOptionsSetAsync)
"_TFE_ContextOptionsSetConfig", referenced from:
__cgo_54a25ea29f0c_Cfunc_TFE_ContextOptionsSetConfig in _x003.o
(maybe you meant: __cgo_54a25ea29f0c_Cfunc_TFE_ContextOptionsSetConfig)
"_TFE_DeleteContext", referenced from:
__cgo_54a25ea29f0c_Cfunc_TFE_DeleteContext in _x003.o
(maybe you meant: __cgo_54a25ea29f0c_Cfunc_TFE_DeleteContextOptions, __cgo_54a25ea29f0c_Cfunc_TFE_DeleteContext )

@vkuznet
Copy link

vkuznet commented Oct 20, 2021

@farshed I think it is question about TF library availability on arm64 architecture rather about tfgo. You should check with TF libs for that platform.

@farshed
Copy link

farshed commented Oct 20, 2021

@vkuznet Thanks for confirming. I was hoping there was a way to run the x86_64 build with Rosetta 2 but I guess I'll just have to wait for the arm64 support.

@yiippee
Copy link

yiippee commented Feb 20, 2022

on wsl2 alse gets the same errors:

github.com/galeone/tensorflow/tensorflow/go imports
        github.com/tensorflow/tensorflow/tensorflow/go/core/protobuf/for_core_protos_go_proto: cannot find module providing package github.com/tensorflow/tensorflow/tensorflow/go/core/protobuf/for_core_protos_go_proto

Do I miss something? Thanks.

@yiippee
Copy link

yiippee commented Feb 20, 2022

According to the official documentation Go bindings for Tensorflow is not supported on Windows systems however according to this comment with a bit of hacking together it may be possible to get it to work.

Do you run on the wsl2 ? I get the same error. Thanks.

@mfreeman451
Copy link

having the same issue on m1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

6 participants