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 no longer builds due to bad import in saved_model.go #34580
A recent change (Change-Id: Iefdf75ed88f54d97a0a7d210f5a42f3123205bf2) has broken an import in file tensorflow/blob/master/tensorflow/go/saved_model.go
@noj-richards, Please provide the exact sequence of commands / steps that you executed before running into the problem. Also include Tensorflow version. Thanks!
go get github.com/tensorflow/tensorflow/tensorflow/go
package github.com/tensorflow/tensorflow/tensorflow/go/genop/internal/proto/github.com/tensorflow/tensorflow/tensorflow/go/core/framework: cannot find package "github.com/tensorflow/tensorflow/tensorflow/go/genop/internal/proto/github.com/tensorflow/tensorflow/tensorflow/go/core/framework" in any of:
/usr/local/Cellar/go/1.13.4/libexec/src/github.com/tensorflow/tensorflow/tensorflow/go/genop/internal/proto/github.com/tensorflow/tensorflow/tensorflow/go/core/framework (from $GOROOT)
/Users/xxxxx/go/src/github.com/tensorflow/tensorflow/tensorflow/go/genop/internal/proto/github.com/tensorflow/tensorflow/tensorflow/go/core/framework (from $GOPATH)
Reacted by Kahlil Abreu, fightthepower, Francisco Carriedo, Richard Cooper and Ziang Ren
go get github.com/tensorflow/tensorflow/tensorflow/go
package github.com/tensorflow/tensorflow/tensorflow/go/genop/internal/proto/github.com/tensorflow/tensorflow/tensorflow/go/core/framework: cannot find package "github.com/tensorflow/tensorflow/tensorflow/go/genop/internal/proto/github.com/tensorflow/tensorflow/tensorflow/go/core/framework" in any of:
/usr/local/Cellar/go/1.13.4/libexec/src/github.com/tensorflow/tensorflow/tensorflow/go/genop/internal/proto/github.com/tensorflow/tensorflow/tensorflow/go/core/framework (from $GOROOT)
/Users/xxxxx/go/src/github.com/tensorflow/tensorflow/tensorflow/go/genop/internal/proto/github.com/tensorflow/tensorflow/tensorflow/go/core/framework (from $GOPATH)
Indeed. That's a simpler minimal example of the prob!
I've faced this issue too. During the building of the Docker image, got
Step 7/10 : RUN go get github.com/tensorflow/tensorflow/tensorflow/go
---> Running in aa0d0a73e640
package github.com/tensorflow/tensorflow/tensorflow/go/genop/internal/proto/github.com/tensorflow/tensorflow/tensorflow/go/core: cannot find package "github.com/tensorflow/tensorflow/tensorflow/go/genop/internal/proto/github.com/tensorflow/tensorflow/tensorflow/go/core" in any of:
/usr/local/go/src/github.com/tensorflow/tensorflow/tensorflow/go/genop/internal/proto/github.com/tensorflow/tensorflow/tensorflow/go/core (from $GOROOT)
/go/src/github.com/tensorflow/tensorflow/tensorflow/go/genop/internal/proto/github.com/tensorflow/tensorflow/tensorflow/go/core (from $GOPATH)
Wow this issue has been completely ignored. It's been almost 2 months! 😡
It's an installation problem, ffs. Not some nice to have or enhancement feature.
And the workaround is extremely hacky and not at all pleasant.
Reacted by Dmitry Yutkin, Andrew Spittlemeister, noj-richards, Giuseppe Annunziata, fightthepower, Abdurrahman, Jérémie Doucy, RedBull, Johan, Gregory Clark and 3 more
Step 8/9 : RUN go get -d github.com/tensorflow/tensorflow/tensorflow/go
---> Running in c8a1c8c24a33
package github.com/tensorflow/tensorflow/tensorflow/go/core/core_protos_go_proto: cannot find package "github.com/tensorflow/tensorflow/tensorflow/go/core/core_protos_go_proto" in any of:
/go/src/github.com/tensorflow/tensorflow/tensorflow/go/core/core_protos_go_proto (from $GOROOT)
/root/go/src/github.com/tensorflow/tensorflow/tensorflow/go/core/core_protos_go_proto (from $GOPATH)
The command '/bin/sh -c go get -d github.com/tensorflow/tensorflow/tensorflow/go' returned a non-zero code: 1
Reacted by Zhisheng Ye, Alessandro Pomponio, John Wass, Abram Van Der Geest, Uzumaaki, RedBull, Jan Hartman, Name, Giau Tran Minh and Milos Colakovic
go: finding module for package github.com/tensorflow/tensorflow/tensorflow/go/core/core_protos_go_proto
../gopath/pkg/mod/github.com/tensorflow/[email protected]+incompatible/tensorflow/go/saved_model.go:24:2: module github.com/tensorflow/tensorflow@latest found (v2.2.0+incompatible), but does not contain package github.com/tensorflow/tensorflow/tensorflow/go/core/core_protos_go_proto
make: *** [release] Error 1
Same problem here, checked my C lib is 2.2.0 but when try to use the go code:
go: finding module for package github.com/tensorflow/tensorflow/tensorflow/go/core/core_protos_go_proto
/home/antonio/go/pkg/mod/github.com/tensorflow/[email protected]+incompatible/tensorflow/go/saved_model.go:24:2: module github.com/tensorflow/tensorflow@latest found (v2.2.0+incompatible), but does not contain package github.com/tensorflow/tensorflow/tensorflow/go/core/core_protos_go_proto
Same problem here. Following command: go get -d github.com/tensorflow/tensorflow/tensorflow/go
produce: package github.com/tensorflow/tensorflow/tensorflow/go/core/core_protos_go_proto: cannot find package "github.com/tensorflow/tensorflow/tensorflow/go/core/core_protos_go_proto" in any of: /usr/local/go/src/github.com/tensorflow/tensorflow/tensorflow/go/core/core_protos_go_proto (from $GOROOT) /home/joceran/go/src/github.com/tensorflow/tensorflow/tensorflow/go/core/core_protos_go_proto (from $GOPATH)
Following command: go generate github.com/tensorflow/tensorflow/tensorflow/go/op
produce: google/protobuf/any.proto: File not found. google/protobuf/duration.proto: File not found. tensorflow/core/protobuf/autotuning.proto:10:1: Import "google/protobuf/any.proto" was not found or had errors. tensorflow/core/protobuf/autotuning.proto:11:1: Import "google/protobuf/duration.proto" was not found or had errors. tensorflow/core/protobuf/autotuning.proto:61:3: "google.protobuf.Duration" is not defined. tensorflow/core/protobuf/autotuning.proto:74:3: "google.protobuf.Any" is not defined. ../genop/main.go:17: running "bash": exit status 1 go/src/github.com/tensorflow/tensorflow/tensorflow/go/op/generate.go:17: running "go": exit status 1
I tried with tensorflow r2.1 (git checkout r2.1) and the go get -d... error disappear. Unfortunately to test the subsequent go generate command I need to compile libtensorflow.so.2 against tensorflow v2.1.0 (mine is compiled against tensroflow 2.2.0 of course).
EDIT: OK my bad, saw the warning on the C libtensorflow about compatibility. So no golang serving until the release of a compatible lib I guess.
Activity
gadagashwini-zz commentedon Nov 26, 2019
@noj-richards, Please provide the exact sequence of commands / steps that you executed before running into the problem. Also include Tensorflow version. Thanks!
noj-richards commentedon Nov 26, 2019
Version is as 'master' with Change-id: Iefdf75ed88f54d97a0a7d210f5a42f3123205bf2
To reproduce simply try and import tf.SavedModel,
e.g:
import (
tf "github.com/tensorflow/tensorflow/tensorflow/go"
)
//Config Config
//CNN CNN
type CNN struct {
model *tf.SavedModel
This will produce the error:
../../../../../github.com/tensorflow/tensorflow/tensorflow/go/saved_model.go:25:2: cannot find package "github.com/tensorflow/tensorflow/tensorflow/go/genop/internal/proto/github.com/tensorflow/tensorflow/tensorflow/go/core/framework" in any of:
/usr/local/go/src/github.com/tensorflow/tensorflow/tensorflow/go/genop/internal/proto/github.com/tensorflow/tensorflow/tensorflow/go/core/framework (from $GOROOT)
/Users/jonrichards/code/go/src/github.com/tensorflow/tensorflow/tensorflow/go/genop/internal/proto/github.com/tensorflow/tensorflow/tensorflow/go/core/framework (from $GOPATH)
AaronReboot commentedon Nov 26, 2019
Confirmed we're having the same prob. Had to revert to commit
36ef4264270e3815ea4b485a52e35e26e43e2112in order to buildjcolson commentedon Dec 2, 2019
is this also causing this failure?
AaronReboot commentedon Dec 3, 2019
Indeed. That's a simpler minimal example of the prob!
yutkin commentedon Dec 13, 2019
I've faced this issue too. During the building of the Docker image, got
kahlil29 commentedon Dec 23, 2019
What's the recommended way to install the go lang tensorflow binding now that this bug has been identified? Is there any fix in the works?
1 remaining item
kahlil29 commentedon Jan 22, 2020
Wow this issue has been completely ignored. It's been almost 2 months! 😡
It's an installation problem, ffs. Not some
nice to haveorenhancementfeature.And the workaround is extremely hacky and not at all pleasant.
yohaiaz commentedon Jan 26, 2020
anyone can help please. trying go get
go get github.com/tensorflow/tensorflow/tensorflow/go
getting an error "cannot find package..."
what i'm doing wrong ?
jhseu commentedon Feb 5, 2020
Fixed as of 4221d1a
tensorflow-bot commentedon Feb 5, 2020
Are you satisfied with the resolution of your issue?
Yes
No
jhseu commentedon Feb 5, 2020
(As a sidenote, please follow the instructions on the Go README which differs slightly from the documentation on tensorflow.org. I'll work on updating the official docs):
https://github.com/tensorflow/tensorflow/blob/master/tensorflow/go/README.md
yutkin commentedon Feb 6, 2020
I still have this issue:
noj-richards commentedon Feb 7, 2020
Yes, Think this is still an issue:
../../../../../github.com/tensorflow/tensorflow/tensorflow/go/saved_model.go:24:2: cannot find package "github.com/tensorflow/tensorflow/tensorflow/go/core/core_protos_go_proto" in any of:
/usr/local/go/src/github.com/tensorflow/tensorflow/tensorflow/go/core/core_protos_go_proto (from $GOROOT)
/Users/xxxx/code/go/src/github.com/tensorflow/tensorflow/tensorflow/go/core/core_protos_go_proto (from $GOPATH)
../../../../../github.com/tensorflow/tensorflow/tensorflow/go/saved_model.go:24:2: cannot find package "github.com/tensorflow/tensorflow/tensorflow/go/core/core_protos_go_proto" in any of:
/usr/local/go/src/github.com/tensorflow/tensorflow/tensorflow/go/core/core_protos_go_proto (from $GOROOT)
ntklink commentedon May 19, 2020
I have this issue too:
go: finding module for package github.com/tensorflow/tensorflow/tensorflow/go/core/core_protos_go_proto
../gopath/pkg/mod/github.com/tensorflow/[email protected]+incompatible/tensorflow/go/saved_model.go:24:2: module github.com/tensorflow/tensorflow@latest found (v2.2.0+incompatible), but does not contain package github.com/tensorflow/tensorflow/tensorflow/go/core/core_protos_go_proto
make: *** [release] Error 1
mkanakis commentedon Jun 12, 2020
Hi,
I am experience the issue as well, any updates?
Running the following command:
Produces the following output:
jdoucy commentedon Jun 19, 2020
Go packages depends on the C lib which is using 1.15 Tensorflow version, go get is trying to get the last 2.2.0.
There is a workaround described here => #23257 (comment)
On my side I use a go.mod file with
require github.com/tensorflow/tensorflow v1.15.0and it worked 🙌
amalbala commentedon Jul 9, 2020
Same problem here, checked my C lib is 2.2.0 but when try to use the go code:
Unfortunatelly I can not dowgrade to TF 1.15
jobale commentedon Jul 22, 2020
With Debian 10 and Tensorflow v2.2
Same problem here. Following command:
go get -d github.com/tensorflow/tensorflow/tensorflow/goproduce:
package github.com/tensorflow/tensorflow/tensorflow/go/core/core_protos_go_proto: cannot find package "github.com/tensorflow/tensorflow/tensorflow/go/core/core_protos_go_proto" in any of: /usr/local/go/src/github.com/tensorflow/tensorflow/tensorflow/go/core/core_protos_go_proto (from $GOROOT) /home/joceran/go/src/github.com/tensorflow/tensorflow/tensorflow/go/core/core_protos_go_proto (from $GOPATH)Following command:
go generate github.com/tensorflow/tensorflow/tensorflow/go/opproduce:
google/protobuf/any.proto: File not found. google/protobuf/duration.proto: File not found. tensorflow/core/protobuf/autotuning.proto:10:1: Import "google/protobuf/any.proto" was not found or had errors. tensorflow/core/protobuf/autotuning.proto:11:1: Import "google/protobuf/duration.proto" was not found or had errors. tensorflow/core/protobuf/autotuning.proto:61:3: "google.protobuf.Duration" is not defined. tensorflow/core/protobuf/autotuning.proto:74:3: "google.protobuf.Any" is not defined. ../genop/main.go:17: running "bash": exit status 1 go/src/github.com/tensorflow/tensorflow/tensorflow/go/op/generate.go:17: running "go": exit status 1I tried with tensorflow r2.1 (git checkout r2.1) and the
go get -d...error disappear. Unfortunately to test the subsequentgo generatecommand I need to compile libtensorflow.so.2 against tensorflow v2.1.0 (mine is compiled against tensroflow 2.2.0 of course).EDIT: OK my bad, saw the warning on the C libtensorflow about compatibility. So no golang serving until the release of a compatible lib I guess.
kyungtae commentedon Nov 19, 2020
Is there any official progress on this?
sdeoras commentedon Dec 7, 2020
running into this error for TF v2.3.1. is there a way to generate this package?
Reverted to TF v1.15.0 and things are working fine:
downloaded c-lib from https://storage.googleapis.com/tensorflow/libtensorflow/libtensorflow-cpu-linux-x86_64-1.15.0.tar.gz