我正在尝试在Power8上运行Tensorflow。由于这不能通电,我需要从源头构建它。为了构建它,我需要Bazel。最新的Ubuntu版本不支持Bazel(据我所知),所以我也需要构建它。在构建Bazel时,我遇到了错误(如下所示)。
我在Power8 here上找到了tensorflow的安装指南。这将我链接到支持bazel权力的github project。
文章告诉我结帐分支v0.2.0-ppc。然后我运行
$./compile.sh
这导致:
[50 / 392] Writing file src/main/java/com/google/devtools/build/lib/libbazel-rulERROR: /home/th/projects/incrementalDL/bazel/third_party/ijar/BUILD:16:1: C++ compilation of rule '//third_party/ijar:zip' failed: gcc failed: error executing command
v0.3.0-ppc导致:
gRPC Java plugin not found in third_party/grpc/protoc-gen-grpc-java-0.13.2-linux-ppc64le.exe
master-with-ppc导致:
Protobuf compiler not found in third_party/protobuf/protoc-linux-ppc64le.exe
最接近Bazel master brach,Power-Support的那个导致:
ERROR: gRPC Java plugin not found in third_party/grpc/protoc-gen-grpc-java-0.15.0-linux-ppc64le.exe
任何提示都将不胜感激!
系统:
$lsb_release -a
Description: Ubuntu 16.04.1 LTS
$java -version
openjdk version "1.8.0_91"
OpenJDK Runtime Environment (build 1.8.0_91-8u91-b14-3ubuntu1~16.04.1-b14)
OpenJDK 64-Bit Server VM (build 25.91-b14, mixed mode)
答案 0 :(得分:1)
我收到了几条私人信息,指出了我正确的方向,所以谢谢你们。这些是允许我在Power8上构建Tensorflow的步骤(我在没有GPU支持的情况下完成了它们):
使用
构建pip包$ bazel build -c opt //tensorflow/tools/pip_package:build_pip_package
因为我不想为GPU编译
出错了
ERROR: /home/th/.cache/bazel/_bazel_th/994c6fd5bf0a6c9879e74e714d455083/external/farmhash_archive/BUILD:5:1:
configure: WARNING: 'missing' script is too old or missing
./config.guess: unable to guess system type
按照错误消息中所述下载最新的config.guess和config.sub:
http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.guess;hb=HEAD
and
http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.sub;hb=HEAD
并将其放在“{lpralf于7月14日发表评论”所提到的目录中,如此tensorflow github issue所述,但这不起作用,所以我将2份副本添加到./[tensorflow-root-dir] / farmhash.BUILD(正如我的错误指示farmhash),在运行configure之前:
cmd = "pushd external/farmhash_archive/%s; workdir=$$(mktemp -d -t tmp.XXXXXXXXXX); cp -a * $$workdir; pushd $$workdir; cp [absolute-path-to-the-downloaded-config.guess]/config.guess .; cp [absolute-path-to-the-downloaded-config.sub]/config.sub .;./configure; popd; popd; cp $$workdir/config.h $(@D); rm -rf $$workdir;" % prefix_dir,
$ bazel-bin/tensorflow/tools/pip_package/build_pip_package /tmp/tensorflow_pkg
$ sudo pip install /tmp/tensorflow_pkg/tensorflow-[whatever-package-is-present].whl
使用
进行测试$ python ./tensorflow/models/image/mnist/convolutional.py
*请注意,tensorflow root dir