tensorflow: Go installation error
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"
About this issue
- Original URL
- State: closed
- Created 4 years ago
- Reactions: 6
- Comments: 27 (6 by maintainers)
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 )
@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.
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”
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
Here’s a summary for anyone who wants this summarized: you cannot use
go getto obtain a functional copy ofgithub.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}/srcand then usinggo generateto 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:
go get github.com/tensorflow/tensorflow/tensorflow/goYou can still use tensorflow/go. A few solutions that may work for you:
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@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…