linux 安裝go tensorflow

伍迪
1 min readMar 2, 2020

--

https://github.com/tensorflow/tensorflow/blob/master/tensorflow/go/README.md

當你下 bazel build -c opt //tensorflow:libtensorflow.so 遇到錯誤或不能編譯的時候 可能是少了一些庫 安裝一下下面的指令 就可以了

比如

ERROR: Analysis of target ‘//tensorflow:libtensorflow.so’ failed; build aborted: no such package ‘@local_config_git//’: Traceback (most recent call last):

File “/home/andy/go/src/github.com/tensorflow/tensorflow/third_party/git/git_configure.bzl”, line 64

_fail(result.stderr)

File “/home/andy/go/src/github.com/tensorflow/tensorflow/third_party/git/git_configure.bzl”, line 14, in _fail

fail(<1 more arguments>)

Git Configuration Error: Traceback (most recent call last):

File “/home/andy/.cache/bazel/_bazel_andy/f2cf79ad05159fbe2046eb79b6c6eacb/external/org_tensorflow/tensorflow/tools/git/gen_git_source.py”, line 32, in <module>

from builtins import bytes # pylint: disable=redefined-builtin

ImportError: No module named builtins

pip — no-cache-dir install \

grpcio \

h5py \

keras_applications \

keras_preprocessing \

mock \

numpy \

requests \

future

Do you wish to build TensorFlow with OpenCL support? [y/N]

這個不要安裝 不然下面會跳一些有的沒的….

--

--

No responses yet