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
Please make sure that this is a build/installation issue. As per our GitHub Policy, we only address code/doc bugs, performance issues, feature requests and build/installation issues on GitHub. tag:build_template
System information
OS Platform and Distribution (e.g., Linux Ubuntu 16.04): mac os 10.14.6
Mobile device (e.g. iPhone 8, Pixel 2, Samsung Galaxy) if the issue happens on mobile device:
TensorFlow installed from (source or binary): n/a
TensorFlow version: n/a
Python version: n/a
Installed using virtualenv? pip? conda?: n/a
Bazel version (if compiling from source): n/a
GCC/Compiler version (if compiling from source): n/a
CUDA/cuDNN version: n/a
GPU model and memory: n/a
Describe the problem
Followed https://www.tensorflow.org/install/lang_go
but got this:
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: cannot find package "github.com/tensorflow/tensorflow/tensorflow/go/genop/internal/proto/github.com/tensorflow/tensorflow/tensorflow/go/core" in any of:
go get -d github.com/tensorflow/tensorflow/tensorflow/go
yielded the same result.
Any other info / logs
Include any logs or source code that would be helpful to diagnose the problem. If including tracebacks, please include the full traceback. Large logs and files should be attached.
Reacted by Kahlil Abreu, Matt B, John Langley, Joshua Newman, stanley, Srinivas Venkatanarayanan and zzSunil
Suspecting my system is in a bad state, I started a tensorflow container and tried to install in it. And it failed in the exact same way. I started to doubt that the whole thing is broken. Can someone spend 10 minutes to try to install it to confirm that it works? (on the other hand, it is really hard to believe that this is broken in such a way) search on google and most of result are from 2 years ago.
➜ tf ./hello_tf
Hello from TensorFlow C library version 1.15.0
➜ tf cd
➜ ~ 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: cannot find package "github.com/tensorflow/tensorflow/tensorflow/go/genop/internal/proto/github.com/tensorflow/tensorflow/tensorflow/go/core" in any of:
/usr/local/Cellar/[email protected]/1.12.13/libexec/src/github.com/tensorflow/tensorflow/tensorflow/go/genop/internal/proto/github.com/tensorflow/tensorflow/tensorflow/go/core (from $GOROOT)
/Users/wschobeiri/go/src/github.com/tensorflow/tensorflow/tensorflow/go/genop/internal/proto/github.com/tensorflow/tensorflow/tensorflow/go/core (from $GOPATH)
RUN go get -d -u -v github.com/tensorflow/tensorflow/tensorflow/go
---> Running in 52496c3a3564
github.com/tensorflow/tensorflow (download)
created GOPATH=/root/go; see 'go help gopath'
github.com/golang/protobuf (download)
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 -u -v github.com/tensorflow/tensorflow/tensorflow/go' returned a non-zero code: 1
You can actually ignore that error for now and run:
$ go generate github.com/tensorflow/tensorflow/tensorflow/go/op
$ go test github.com/tensorflow/tensorflow/tensorflow/go
ok github.com/tensorflow/tensorflow/tensorflow/go 0.182s
UPDATING as I switched machines in the middle, both were with different Go versions, both attempts failed.
Attempt#1:
With
$ go version
go1.11.4 darwin/amd64
And
$ bazel version
Build label: 2.0.0
Build target: bazel-out/darwin-opt/bin/src/main/java/com/google/devtools/build/lib/bazel/BazelServer_deploy.jar
Build time: Thu Dec 19 12:33:30 2019 (1576758810)
Build timestamp: 1576758810
Build timestamp as int: 1576758810
Installed this version by removing current bazel using brew and running $ brew install https://raw.githubusercontent.com/bazelbuild/homebrew-tap/1bd39af61f9731fd03ba4dde408a0cb4198bc76d/Formula/bazel.rb
Then I tried running my code again:
$ go run main.go
go: finding module for package github.com/tensorflow/tensorflow/tensorflow/go/core/core_protos_go_proto
(in the first attempt:) go: downloading github.com/tensorflow/tensorflow v1.15.2
../../../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
$ go get -d github.com/tensorflow/tensorflow/tensorflow/go
go: found github.com/tensorflow/tensorflow/tensorflow/go in github.com/tensorflow/tensorflow v2.2.0+incompatible
go: finding module for package github.com/tensorflow/tensorflow/tensorflow/go/core/core_protos_go_proto
$cd ${GOPATH}/src/github.com/tensorflow/tensorflow
$./configure
Traceback (most recent call last):
File "./configure.py", line 1549, in <module>
main()
File "./configure.py", line 1365, in main
_TF_MAX_BAZEL_VERSION)
File "./configure.py", line 478, in check_bazel_version
['bazel', '--batch', '--bazelrc=/dev/null', 'version'])
File "./configure.py", line 156, in run_shell
output = subprocess.check_output(cmd)
File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/subprocess.py", line 573, in check_output
raise CalledProcessError(retcode, cmd, output=output)
subprocess.CalledProcessError: Command '['bazel', '--batch', '--bazelrc=/dev/null', 'version']' returned non-zero exit status 1
People in the thread seem to have succeeded with the bazel v2.0.0 but this doesn't seem to work for me. So bumping as well.
Attempt#2:
Switched to a machine with go1.14.2 darwin/amd64 and downgraded bazel to v2.0.0 and got:
$ ./configure
WARNING: current bazel installation is not a release version.
Make sure you are running at least bazel 2.0.0
...
This succeeded, but the next command didn't:
$ bazel build -c opt //tensorflow:libtensorflow.so
ERROR: The project you're trying to build requires Bazel 3.0.0 (specified in $GOPATH/src/github.com/tensorflow/tensorflow/.bazelversion), but it wasn't found in /usr/local/bin/../Cellar/bazel/2.0.0/bin.
Upgraded to bazel v3.0.0 and later to bazel v3.1.0, got the same error in both cases, seem to be rooted in numpy:
$ bazel build -c opt //tensorflow:libtensorflow.so
Extracting Bazel installation...
Starting local Bazel server and connecting to it...
INFO: Options provided by the client:
Inherited 'common' options: --isatty=1 --terminal_columns=179
INFO: Reading rc options for 'build' from $GOPATH/src/github.com/tensorflow/tensorflow/.bazelrc:
Inherited 'common' options: --experimental_repo_remote_exec
INFO: Reading rc options for 'build' from $GOPATH/src/github.com/tensorflow/tensorflow/.bazelrc:
'build' options: --apple_platform_type=macos --define framework_shared_object=true --define open_source_build=true --java_toolchain=//third_party/toolchains/java:tf_java_toolchain --host_java_toolchain=//third_party/toolchains/java:tf_java_toolchain --define=use_fast_cpp_protos=true --define=allow_oversize_protos=true --spawn_strategy=standalone -c opt --announce_rc --define=grpc_no_ares=true --noincompatible_remove_legacy_whole_archive --noincompatible_prohibit_aapt1 --enable_platform_specific_config --config=v2
INFO: Reading rc options for 'build' from $GOPATH/src/github.com/tensorflow/tensorflow/.tf_configure.bazelrc:
'build' options: --action_env PYTHON_BIN_PATH=/usr/local/opt/python/bin/python3.7 --action_env PYTHON_LIB_PATH=/usr/local/Cellar/python/3.7.2/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages --python_path=/usr/local/opt/python/bin/python3.7 --config=xla --action_env TF_CONFIGURE_IOS=0
INFO: Found applicable config definition build:v2 in file $GOPATH/src/github.com/tensorflow/tensorflow/.bazelrc: --define=tf_api_version=2 --action_env=TF2_BEHAVIOR=1
INFO: Found applicable config definition build:xla in file $GOPATH/src/github.com/tensorflow/tensorflow/.bazelrc: --action_env=TF_ENABLE_XLA=1 --define=with_xla_support=true
INFO: Found applicable config definition build:macos in file $GOPATH/src/github.com/tensorflow/tensorflow/.bazelrc: --copt=-w --define=PREFIX=/usr --define=LIBDIR=$(PREFIX)/lib --define=INCLUDEDIR=$(PREFIX)/include --cxxopt=-std=c++14 --host_cxxopt=-std=c++14
DEBUG: Rule 'io_bazel_rules_docker' indicated that a canonical reproducible form can be obtained by modifying arguments shallow_since = "1556410077 -0400"
DEBUG: Call stack for the definition of repository 'io_bazel_rules_docker' which is a git_repository (rule definition at /private/var/tmp/_bazel_$USER/79ab9535b528f2bf6382aeb7c6f1eede/external/bazel_tools/tools/build_defs/repo/git.bzl:195:18):
- <builtin>
- /private/var/tmp/_bazel_$USER/79ab9535b528f2bf6382aeb7c6f1eede/external/bazel_toolchains/repositories/repositories.bzl:37:9
- $GOPATH/src/github.com/tensorflow/tensorflow/WORKSPACE:37:1
INFO: Call stack for the definition of repository 'local_execution_config_python' which is a local_python_configure (rule definition at $GOPATH/src/github.com/tensorflow/tensorflow/third_party/py/python_configure.bzl:275:26):
- <builtin>
- $GOPATH/src/github.com/tensorflow/tensorflow/third_party/toolchains/remote_config/rbe_config.bzl:158:5
- $GOPATH/src/github.com/tensorflow/tensorflow/third_party/toolchains/remote_config/configs.bzl:6:5
- $GOPATH/src/github.com/tensorflow/tensorflow/tensorflow/workspace.bzl:93:5
- $GOPATH/src/github.com/tensorflow/tensorflow/WORKSPACE:19:1
INFO: Call stack for the definition of repository 'local_config_python' which is a python_configure (rule definition at $GOPATH/src/github.com/tensorflow/tensorflow/third_party/py/python_configure.bzl:294:20):
- <builtin>
- $GOPATH/src/github.com/tensorflow/tensorflow/tensorflow/workspace.bzl:104:5
- $GOPATH/src/github.com/tensorflow/tensorflow/WORKSPACE:19:1
ERROR: An error occurred during the fetch of repository 'local_execution_config_python':
Traceback (most recent call last):
File "$GOPATH/src/github.com/tensorflow/tensorflow/third_party/py/python_configure.bzl", line 213
_get_numpy_include(<2 more arguments>)
File "$GOPATH/src/github.com/tensorflow/tensorflow/third_party/py/python_configure.bzl", line 187, in _get_numpy_include
execute(repository_ctx, <3 more arguments>)
File "$GOPATH/src/github.com/tensorflow/tensorflow/third_party/remote_config/common.bzl", line 208, in execute
fail(<1 more arguments>)
Problem getting numpy include path.
Traceback (most recent call last):
File "<string>", line 1, in <module>
ModuleNotFoundError: No module named 'numpy'
Is numpy installed?
Internal error thrown during build. Printing stack trace: java.lang.NullPointerException: //tensorflow:libtensorflow.so BuildConfigurationValue.Key[e92daf9dedbad5a840c1dcea19bb219b430534f835df513bcb8c6de1073f33ce] false
at com.google.common.base.Preconditions.checkNotNull(Preconditions.java:895)
at com.google.devtools.build.skyframe.DelegatingWalkableGraph.getDirectDeps(DelegatingWalkableGraph.java:121)
at com.google.devtools.build.lib.skyframe.SkyframeBuildView.assertSaneAnalysisError(SkyframeBuildView.java:773)
at com.google.devtools.build.lib.skyframe.SkyframeBuildView.processErrors(SkyframeBuildView.java:616)
at com.google.devtools.build.lib.skyframe.SkyframeBuildView.configureTargets(SkyframeBuildView.java:454)
at com.google.devtools.build.lib.analysis.BuildView.update(BuildView.java:404)
at com.google.devtools.build.lib.buildtool.AnalysisPhaseRunner.runAnalysisPhase(AnalysisPhaseRunner.java:213)
at com.google.devtools.build.lib.buildtool.AnalysisPhaseRunner.execute(AnalysisPhaseRunner.java:124)
at com.google.devtools.build.lib.buildtool.BuildTool.buildTargets(BuildTool.java:145)
at com.google.devtools.build.lib.buildtool.BuildTool.processRequest(BuildTool.java:290)
at com.google.devtools.build.lib.runtime.commands.BuildCommand.exec(BuildCommand.java:95)
at com.google.devtools.build.lib.runtime.BlazeCommandDispatcher.execExclusively(BlazeCommandDispatcher.java:564)
at com.google.devtools.build.lib.runtime.BlazeCommandDispatcher.exec(BlazeCommandDispatcher.java:208)
at com.google.devtools.build.lib.server.GrpcServerImpl.executeCommand(GrpcServerImpl.java:603)
at com.google.devtools.build.lib.server.GrpcServerImpl.lambda$run$2(GrpcServerImpl.java:659)
at io.grpc.Context$1.run(Context.java:595)
at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
at java.base/java.lang.Thread.run(Unknown Source)
INFO: Elapsed time: 19.355s
INFO: 0 processes.
FAILED: Build did NOT complete successfully (12 packages loaded, 17 targets configured)
Fetching @local_config_cc_toolchains; fetching
Internal error thrown during build. Printing stack trace: java.lang.NullPointerException: //tensorflow:libtensorflow.so BuildConfigurationValue.Key[e92daf9dedbad5a840c1dcea19bb219b430534f835df513bcb8c6de1073f33ce] false
at com.google.common.base.Preconditions.checkNotNull(Preconditions.java:895)
at com.google.devtools.build.skyframe.DelegatingWalkableGraph.getDirectDeps(DelegatingWalkableGraph.java:121)
at com.google.devtools.build.lib.skyframe.SkyframeBuildView.assertSaneAnalysisError(SkyframeBuildView.java:773)
at com.google.devtools.build.lib.skyframe.SkyframeBuildView.processErrors(SkyframeBuildView.java:616)
at com.google.devtools.build.lib.skyframe.SkyframeBuildView.configureTargets(SkyframeBuildView.java:454)
at com.google.devtools.build.lib.analysis.BuildView.update(BuildView.java:404)
at com.google.devtools.build.lib.buildtool.AnalysisPhaseRunner.runAnalysisPhase(AnalysisPhaseRunner.java:213)
at com.google.devtools.build.lib.buildtool.AnalysisPhaseRunner.execute(AnalysisPhaseRunner.java:124)
at com.google.devtools.build.lib.buildtool.BuildTool.buildTargets(BuildTool.java:145)
at com.google.devtools.build.lib.buildtool.BuildTool.processRequest(BuildTool.java:290)
at com.google.devtools.build.lib.runtime.commands.BuildCommand.exec(BuildCommand.java:95)
at com.google.devtools.build.lib.runtime.BlazeCommandDispatcher.execExclusively(BlazeCommandDispatcher.java:564)
at com.google.devtools.build.lib.runtime.BlazeCommandDispatcher.exec(BlazeCommandDispatcher.java:208)
at com.google.devtools.build.lib.server.GrpcServerImpl.executeCommand(GrpcServerImpl.java:603)
at com.google.devtools.build.lib.server.GrpcServerImpl.lambda$run$2(GrpcServerImpl.java:659)
at io.grpc.Context$1.run(Context.java:595)
at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
at java.base/java.lang.Thread.run(Unknown Source)
java.lang.NullPointerException: //tensorflow:libtensorflow.so BuildConfigurationValue.Key[e92daf9dedbad5a840c1dcea19bb219b430534f835df513bcb8c6de1073f33ce] false
at com.google.common.base.Preconditions.checkNotNull(Preconditions.java:895)
at com.google.devtools.build.skyframe.DelegatingWalkableGraph.getDirectDeps(DelegatingWalkableGraph.java:121)
at com.google.devtools.build.lib.skyframe.SkyframeBuildView.assertSaneAnalysisError(SkyframeBuildView.java:773)
at com.google.devtools.build.lib.skyframe.SkyframeBuildView.processErrors(SkyframeBuildView.java:616)
at com.google.devtools.build.lib.skyframe.SkyframeBuildView.configureTargets(SkyframeBuildView.java:454)
at com.google.devtools.build.lib.analysis.BuildView.update(BuildView.java:404)
at com.google.devtools.build.lib.buildtool.AnalysisPhaseRunner.runAnalysisPhase(AnalysisPhaseRunner.java:213)
at com.google.devtools.build.lib.buildtool.AnalysisPhaseRunner.execute(AnalysisPhaseRunner.java:124)
at com.google.devtools.build.lib.buildtool.BuildTool.buildTargets(BuildTool.java:145)
at com.google.devtools.build.lib.buildtool.BuildTool.processRequest(BuildTool.java:290)
at com.google.devtools.build.lib.runtime.commands.BuildCommand.exec(BuildCommand.java:95)
at com.google.devtools.build.lib.runtime.BlazeCommandDispatcher.execExclusively(BlazeCommandDispatcher.java:564)
at com.google.devtools.build.lib.runtime.BlazeCommandDispatcher.exec(BlazeCommandDispatcher.java:208)
at com.google.devtools.build.lib.server.GrpcServerImpl.executeCommand(GrpcServerImpl.java:603)
at com.google.devtools.build.lib.server.GrpcServerImpl.lambda$run$2(GrpcServerImpl.java:659)
at io.grpc.Context$1.run(Context.java:595)
at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
FAILED: Build did NOT complete successfully (12 packages loaded, 17 targets configured)
Fetching @local_config_cc_toolchains; fetching
➜ tensorflow git:(master) bazel build -c opt //tensorflow:libtensorflow.so
Starting local Bazel server and connecting to it...
INFO: Options provided by the client:
Inherited 'common' options: --isatty=1 --terminal_columns=179
INFO: Reading rc options for 'build' from $GOPATH/src/github.com/tensorflow/tensorflow/.bazelrc:
Inherited 'common' options: --experimental_repo_remote_exec
INFO: Reading rc options for 'build' from $GOPATH/src/github.com/tensorflow/tensorflow/.bazelrc:
'build' options: --apple_platform_type=macos --define framework_shared_object=true --define open_source_build=true --java_toolchain=//third_party/toolchains/java:tf_java_toolchain --host_java_toolchain=//third_party/toolchains/java:tf_java_toolchain --define=use_fast_cpp_protos=true --define=allow_oversize_protos=true --spawn_strategy=standalone -c opt --announce_rc --define=grpc_no_ares=true --noincompatible_remove_legacy_whole_archive --noincompatible_prohibit_aapt1 --enable_platform_specific_config --config=v2
INFO: Reading rc options for 'build' from $GOPATH/src/github.com/tensorflow/tensorflow/.tf_configure.bazelrc:
'build' options: --action_env PYTHON_BIN_PATH=/usr/local/opt/python/bin/python3.7 --action_env PYTHON_LIB_PATH=/usr/local/Cellar/python/3.7.2/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages --python_path=/usr/local/opt/python/bin/python3.7 --config=xla --action_env TF_CONFIGURE_IOS=0
INFO: Found applicable config definition build:v2 in file $GOPATH/src/github.com/tensorflow/tensorflow/.bazelrc: --define=tf_api_version=2 --action_env=TF2_BEHAVIOR=1
INFO: Found applicable config definition build:xla in file $GOPATH/src/github.com/tensorflow/tensorflow/.bazelrc: --action_env=TF_ENABLE_XLA=1 --define=with_xla_support=true
INFO: Found applicable config definition build:macos in file $GOPATH/src/github.com/tensorflow/tensorflow/.bazelrc: --copt=-w --define=PREFIX=/usr --define=LIBDIR=$(PREFIX)/lib --define=INCLUDEDIR=$(PREFIX)/include --cxxopt=-std=c++14 --host_cxxopt=-std=c++14
INFO: Call stack for the definition of repository 'local_config_python' which is a python_configure (rule definition at $GOPATH/src/github.com/tensorflow/tensorflow/third_party/py/python_configure.bzl:294:20):
- <builtin>
- $GOPATH/src/github.com/tensorflow/tensorflow/tensorflow/workspace.bzl:104:5
- $GOPATH/src/github.com/tensorflow/tensorflow/WORKSPACE:19:1
INFO: Call stack for the definition of repository 'local_execution_config_python' which is a local_python_configure (rule definition at $GOPATH/src/github.com/tensorflow/tensorflow/third_party/py/python_configure.bzl:275:26):
- <builtin>
- $GOPATH/src/github.com/tensorflow/tensorflow/third_party/toolchains/remote_config/rbe_config.bzl:158:5
- $GOPATH/src/github.com/tensorflow/tensorflow/third_party/toolchains/remote_config/configs.bzl:6:5
- $GOPATH/src/github.com/tensorflow/tensorflow/tensorflow/workspace.bzl:93:5
- $GOPATH/src/github.com/tensorflow/tensorflow/WORKSPACE:19:1
ERROR: An error occurred during the fetch of repository 'local_execution_config_python':
Traceback (most recent call last):
File "$GOPATH/src/github.com/tensorflow/tensorflow/third_party/py/python_configure.bzl", line 213
_get_numpy_include(<2 more arguments>)
File "$GOPATH/src/github.com/tensorflow/tensorflow/third_party/py/python_configure.bzl", line 187, in _get_numpy_include
execute(repository_ctx, <3 more arguments>)
File "$GOPATH/src/github.com/tensorflow/tensorflow/third_party/remote_config/common.bzl", line 208, in execute
fail(<1 more arguments>)
Problem getting numpy include path.
Traceback (most recent call last):
File "<string>", line 1, in <module>
ModuleNotFoundError: No module named 'numpy'
Is numpy installed?
Internal error thrown during build. Printing stack trace: java.lang.NullPointerException: //tensorflow:libtensorflow.so BuildConfigurationValue.Key[e92daf9dedbad5a840c1dcea19bb219b430534f835df513bcb8c6de1073f33ce] false
at com.google.common.base.Preconditions.checkNotNull(Preconditions.java:895)
at com.google.devtools.build.skyframe.DelegatingWalkableGraph.getDirectDeps(DelegatingWalkableGraph.java:121)
at com.google.devtools.build.lib.skyframe.SkyframeBuildView.assertSaneAnalysisError(SkyframeBuildView.java:773)
at com.google.devtools.build.lib.skyframe.SkyframeBuildView.processErrors(SkyframeBuildView.java:616)
at com.google.devtools.build.lib.skyframe.SkyframeBuildView.configureTargets(SkyframeBuildView.java:454)
at com.google.devtools.build.lib.analysis.BuildView.update(BuildView.java:404)
at com.google.devtools.build.lib.buildtool.AnalysisPhaseRunner.runAnalysisPhase(AnalysisPhaseRunner.java:213)
at com.google.devtools.build.lib.buildtool.AnalysisPhaseRunner.execute(AnalysisPhaseRunner.java:124)
at com.google.devtools.build.lib.buildtool.BuildTool.buildTargets(BuildTool.java:145)
at com.google.devtools.build.lib.buildtool.BuildTool.processRequest(BuildTool.java:290)
at com.google.devtools.build.lib.runtime.commands.BuildCommand.exec(BuildCommand.java:95)
at com.google.devtools.build.lib.runtime.BlazeCommandDispatcher.execExclusively(BlazeCommandDispatcher.java:564)
at com.google.devtools.build.lib.runtime.BlazeCommandDispatcher.exec(BlazeCommandDispatcher.java:208)
at com.google.devtools.build.lib.server.GrpcServerImpl.executeCommand(GrpcServerImpl.java:603)
at com.google.devtools.build.lib.server.GrpcServerImpl.lambda$run$2(GrpcServerImpl.java:659)
at io.grpc.Context$1.run(Context.java:595)
at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
at java.base/java.lang.Thread.run(Unknown Source)
INFO: Elapsed time: 2.530s
INFO: 0 processes.
FAILED: Build did NOT complete successfully (12 packages loaded, 17 targets configured)
Fetching @local_config_cc_toolchains; fetching
Internal error thrown during build. Printing stack trace: java.lang.NullPointerException: //tensorflow:libtensorflow.so BuildConfigurationValue.Key[e92daf9dedbad5a840c1dcea19bb219b430534f835df513bcb8c6de1073f33ce] false
at com.google.common.base.Preconditions.checkNotNull(Preconditions.java:895)
at com.google.devtools.build.skyframe.DelegatingWalkableGraph.getDirectDeps(DelegatingWalkableGraph.java:121)
at com.google.devtools.build.lib.skyframe.SkyframeBuildView.assertSaneAnalysisError(SkyframeBuildView.java:773)
at com.google.devtools.build.lib.skyframe.SkyframeBuildView.processErrors(SkyframeBuildView.java:616)
at com.google.devtools.build.lib.skyframe.SkyframeBuildView.configureTargets(SkyframeBuildView.java:454)
at com.google.devtools.build.lib.analysis.BuildView.update(BuildView.java:404)
at com.google.devtools.build.lib.buildtool.AnalysisPhaseRunner.runAnalysisPhase(AnalysisPhaseRunner.java:213)
at com.google.devtools.build.lib.buildtool.AnalysisPhaseRunner.execute(AnalysisPhaseRunner.java:124)
at com.google.devtools.build.lib.buildtool.BuildTool.buildTargets(BuildTool.java:145)
at com.google.devtools.build.lib.buildtool.BuildTool.processRequest(BuildTool.java:290)
at com.google.devtools.build.lib.runtime.commands.BuildCommand.exec(BuildCommand.java:95)
at com.google.devtools.build.lib.runtime.BlazeCommandDispatcher.execExclusively(BlazeCommandDispatcher.java:564)
at com.google.devtools.build.lib.runtime.BlazeCommandDispatcher.exec(BlazeCommandDispatcher.java:208)
at com.google.devtools.build.lib.server.GrpcServerImpl.executeCommand(GrpcServerImpl.java:603)
at com.google.devtools.build.lib.server.GrpcServerImpl.lambda$run$2(GrpcServerImpl.java:659)
at io.grpc.Context$1.run(Context.java:595)
at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
at java.base/java.lang.Thread.run(Unknown Source)
java.lang.NullPointerException: //tensorflow:libtensorflow.so BuildConfigurationValue.Key[e92daf9dedbad5a840c1dcea19bb219b430534f835df513bcb8c6de1073f33ce] false
at com.google.common.base.Preconditions.checkNotNull(Preconditions.java:895)
at com.google.devtools.build.skyframe.DelegatingWalkableGraph.getDirectDeps(DelegatingWalkableGraph.java:121)
at com.google.devtools.build.lib.skyframe.SkyframeBuildView.assertSaneAnalysisError(SkyframeBuildView.java:773)
at com.google.devtools.build.lib.skyframe.SkyframeBuildView.processErrors(SkyframeBuildView.java:616)
at com.google.devtools.build.lib.skyframe.SkyframeBuildView.configureTargets(SkyframeBuildView.java:454)
at com.google.devtools.build.lib.analysis.BuildView.update(BuildView.java:404)
at com.google.devtools.build.lib.buildtool.AnalysisPhaseRunner.runAnalysisPhase(AnalysisPhaseRunner.java:213)
at com.google.devtools.build.lib.buildtool.AnalysisPhaseRunner.execute(AnalysisPhaseRunner.java:124)
at com.google.devtools.build.lib.buildtool.BuildTool.buildTargets(BuildTool.java:145)
at com.google.devtools.build.lib.buildtool.BuildTool.processRequest(BuildTool.java:290)
at com.google.devtools.build.lib.runtime.commands.BuildCommand.exec(BuildCommand.java:95)
at com.google.devtools.build.lib.runtime.BlazeCommandDispatcher.execExclusively(BlazeCommandDispatcher.java:564)
at com.google.devtools.build.lib.runtime.BlazeCommandDispatcher.exec(BlazeCommandDispatcher.java:208)
at com.google.devtools.build.lib.server.GrpcServerImpl.executeCommand(GrpcServerImpl.java:603)
at com.google.devtools.build.lib.server.GrpcServerImpl.lambda$run$2(GrpcServerImpl.java:659)
at io.grpc.Context$1.run(Context.java:595)
at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
FAILED: Build did NOT complete successfully (12 packages loaded, 17 targets configured)
Fetching @local_config_cc_toolchains; fetching
you need to checkout to r1.11 branch, as explained here, or you can install the master plus the latest version of the C library (1.15) and in your go.mod under require change the package version to github.com/tensorflow/tensorflow v1.11.0 so that you wouldn't have to checkout to that branch every time you import the package.
I highly recommend you to fallback on the galeone/tensorflow + galeone/tfgo solution, which is used by several go devs and it seems to work pretty well, solving all these problems.
In short:
Install the TensorFlow C library
go env -w GONOSUMDB="github.com/galeone/tensorflow"
go get github.com/galeone/tfgo
And in your source code, instead of using the official tensorflow package, use
# github.com/galeone/tensorflow/tensorflow/go
/usr/bin/ld: /usr/local/lib/libtensorflow.so: .dynsym local symbol at index 857 (>= sh_info of 2)
/usr/bin/ld: /usr/local/lib/libtensorflow.so: .dynsym local symbol at index 1944 (>= sh_info of 2)
/usr/bin/ld: /usr/local/lib/libtensorflow.so: .dynsym local symbol at index 2314 (>= sh_info of 2)
/usr/bin/ld: /usr/local/lib/libtensorflow.so: .dynsym local symbol at index 2502 (>= sh_info of 2)
/usr/bin/ld: /usr/local/lib/libtensorflow.so: .dynsym local symbol at index 2724 (>= sh_info of 2)
/usr/bin/ld: /usr/local/lib/libtensorflow.so: .dynsym local symbol at index 2725 (>= sh_info of 2)
go get: added github.com/galeone/tfgo v0.0.0-20210204182614-84b9a5e77f79
Activity
ymodak commentedon Dec 16, 2019
I think there is a typo in your
getcommand there isn't package word in the end.Can you try again with,
go get github.com/tensorflow/tensorflow/tensorflow/goAlso did you setup https://www.tensorflow.org/install/lang_go#tensorflow_c_library before installing TF Go.
freemanliu commentedon Dec 16, 2019
hi, ymodak,
Thanks for the quick response!
The "package" is the starting of the output of the command.
C library is installed. Here is how it works:
$gcc hello_tf.c -ltensorflow -o hello_tf
$./hello_tf
Hello from TensorFlow C library version 1.15.0
I also tried on linux and the result is same.
Neither does building from source work.
I also checked github for
"github.com/tensorflow/tensorflow/tensorflow/go/genop/internal/proto/github.com/tensorflow/tensorflow/tensorflow/go/core". But it stopped at
https://github.com/tensorflow/tensorflow/tree/master/tensorflow/go/genop/internal.
Is the left part generated automatically? If so, how?
Cheers,
Freeman
freemanliu commentedon Dec 17, 2019
Suspecting my system is in a bad state, I started a tensorflow container and tried to install in it. And it failed in the exact same way. I started to doubt that the whole thing is broken. Can someone spend 10 minutes to try to install it to confirm that it works? (on the other hand, it is really hard to believe that this is broken in such a way) search on google and most of result are from 2 years ago.
freemanliu commentedon Dec 17, 2019
Otherwise I have to switch to the tensorflow java.
freemanliu commentedon Dec 18, 2019
saw #23257. Not exactly the same issue. But the common part is that installing tensorflow for go fails. There should be an integration test for this.
nphase commentedon Dec 26, 2019
I have this same issue:
17 remaining items
yutkin commentedon Feb 6, 2020
The same issue:
jhseu commentedon Feb 6, 2020
You can actually ignore that error for now and run:
yutkin commentedon Feb 6, 2020
I cannot ignore it, because
go get -d github.com/tensorflow/tensorflow/tensorflow/gofails with exit code 1, that interrupts build of Docker image.glarchev commentedon Feb 19, 2020
The installation steps in README also fail on the
./configurestep if you don't have bazel version 2.0.0 (I have 2.1.0).mathisve commentedon Mar 3, 2020
I know #36523 is still open and waiting for review, but I just wanted to bump.
Pisush commentedon May 10, 2020
UPDATING as I switched machines in the middle, both were with different Go versions, both attempts failed.
Attempt#1:
With
And
Installed this version by removing current bazel using brew and running
$ brew install https://raw.githubusercontent.com/bazelbuild/homebrew-tap/1bd39af61f9731fd03ba4dde408a0cb4198bc76d/Formula/bazel.rbThen I tried running my code again:
Then switched to following go Go installation instructions:
People in the thread seem to have succeeded with the bazel v2.0.0 but this doesn't seem to work for me. So bumping as well.
Attempt#2:
Switched to a machine with
go1.14.2 darwin/amd64and downgraded bazel to v2.0.0 and got:This succeeded, but the next command didn't:
Upgraded to
bazel v3.0.0and later tobazel v3.1.0, got the same error in both cases, seem to be rooted innumpy:atahmasb commentedon May 21, 2020
you need to checkout to r1.11 branch, as explained here, or you can install the master plus the latest version of the C library (1.15) and in your
go.modunderrequirechange the package version togithub.com/tensorflow/tensorflow v1.11.0so that you wouldn't have to checkout to that branch every time you import the package.galeone commentedon Feb 16, 2021
Since this issue isn't getting fixed, I decided to maintain a fork: https://github.com/galeone/tensorflow
You can also use tfgo that depends on the fork and it allows a simplified usage of the Go bindings:
gg187on commentedon Mar 25, 2021
@galeone getting error:
when trying
go get github.com/galeone/tensorflow/tensorflow/[email protected]galeone commentedon Mar 25, 2021
This solution is old, I'm sorry.
The solution is to NOT use the official tensorflow go package, but instead use my fork:
Obviously, you should fir install the TensorFlow C library in your system (see here: https://github.com/galeone/tfgo#tensorflow-installation)
I highly recommend you to fallback on the galeone/tensorflow + galeone/tfgo solution, which is used by several go devs and it seems to work pretty well, solving all these problems.
In short:
And in your source code, instead of using the official tensorflow package, use
import (
"fmt"
tg "github.com/galeone/tfgo"
tf "github.com/galeone/tensorflow/tensorflow/go"
)
Have a look at the readme in the tfgo repo to find a working example and a step by step guidance: https://github.com/galeone/tfgo/
Let me know if it works for you.
gg187on commentedon Mar 25, 2021
is this correct output? @galeone
gg187on commentedon Mar 25, 2021
it seems to work, thanks so much @galeone
galeone commentedon Mar 26, 2021
Great! Have you fixed the linking problem you posted before?
amyxguo commentedon Apr 8, 2021
Also curious about this
BigCatGit commentedon Apr 2, 2022
is work