在IBM POWER8上安装TensorFlow [英] installing TensorFlow on the IBM power8

查看:15
本文介绍了在IBM POWER8上安装TensorFlow的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我可以访问一台大型IBM Power8计算机,并希望在其上安装TensorFlow。当然,我尝试了快速pip安装,但失败了:

sudo pip install https://storage.googleapis.com/tensorflow/linux/cpu/tensorflow-0.6.0-cp27-none-linux_x86_64.whl
tensorflow-0.6.0-cp27-none-linux_x86_64.whl is not a supported wheel on this platform.
Storing debug log for failure in /home/pv/.pip/pip.log

遗憾的是,pin.log包含的有用信息很少。

/usr/bin/pip run on Sat Feb  6 17:29:34 2016
tensorflow-0.6.0-cp27-none-linux_x86_64.whl is not a supported wheel on this platform.
Exception information:
Traceback (most recent call last):
  File "/usr/lib/python2.7/dist-packages/pip/basecommand.py", line 122, in main
    status = self.run(options, args)
  File "/usr/lib/python2.7/dist-packages/pip/commands/install.py", line 283, in run
    InstallRequirement.from_line(name, None))
  File "/usr/lib/python2.7/dist-packages/pip/req.py", line 168, in from_line
    raise UnsupportedWheel("%s is not a supported wheel on this platform." % wheel.filename)
UnsupportedWheel: tensorflow-0.6.0-cp27-none-linux_x86_64.whl is not a supported wheel on this platform.

我尝试的下一件事是从源代码构建TensorFlow。无济于事,我所有的尝试都以一些cannot execute binary file: Exec format error消息结束,例如:

/usr/local/bin/bazel: line 86: /usr/local/lib/bazel/bin/bazel-real: cannot execute binary file: Exec format error

然后我尝试从源代码编译Bazel,这也导致了类似的硬错误。

me@machine:~/bazel-0.1.5$ ./compile.sh
INFO: You can skip this first step by providing a path to the bazel binary as second argument:
INFO:    ./compile.sh compile /path/to/bazel
🍃  Building Bazel from scratch.
Compiling Java stubs for protocol buffers...
third_party/protobuf/protoc-linux-x86_32.exe -Isrc/main/protobuf/ --java_out=/tmp/bazel.T9C83cNa/src src/main/protobuf/android_studio_ide_info.proto
scripts/bootstrap/buildenv.sh: line 63: third_party/protobuf/protoc-linux-x86_32.exe: cannot execute binary file: Exec format error
pv@sardonis:~/bazel-0.1.5$ ^C
但是,我找到了这个http://www.cnblogs.com/rodenpark/p/5007744.html链接,它解释了如何在Power8机器上从源代码构建Protobuf编译器。这起作用了,在他的另一个主题http://www.cnblogs.com/rodenpark/p/5007846.html中描述的修改之后,我至少设法开始了编译过程。但现在它崩溃了,有一大堆错误,每个错误看起来都没有那么严重,但大量的错误让它看起来真的没有希望了,我把它们贴在http://pastebin.com/KjkseaGx上供参考。

所以..。我的灵感快用完了。如何才能使TensorFlow在Power8计算机上工作?

推荐答案

安装Bazel 0.2.0-ppc

tf@ubuntu16:~$ git clone https://github.com/ibmsoe/bazel
tf@ubuntu16:~/bazel$ git checkout v0.2.0-ppc
tf@ubuntu16:~/bazel$ ./compile.sh

安装TensorFlow

tf@ubuntu16:~$ git clone --recurse-submodules https://github.com/tensorflow/tensorflow
tf@ubuntu16:~/tensorflow$ git checkout  v0.10.0rc0
tf@ubuntu16:~/tensorflow$ git commit -m"v0.10.0rc0"
tf@ubuntu16:~/tensorflow$ git cherry-pick ce70f6cf842a46296119337247c24d307e279fa0
tf@ubuntu16:~/tensorflow$ git cherry-pick f1acb3bd828a73b15670fc8019f06a5cd51bd564
tf@ubuntu16:~/tensorflow$ git cherry-pick 9b6215a691a2eebaadb8253bd0cf706f2309a0b8
tf@ubuntu16:~/tensorflow$ ./configure
tf@ubuntu16:~/tensorflow$ bazel build -c opt --config=cuda //tensorflow/tools/pip_package:build_pip_package

在这里您将遇到一个错误,如下所示

错误:/home/tf/.cache/bazel/_bazel_tf/b2f766da603b0bed56d4c1d0b178456a/external/farmhash_archive/BUILD:5:1:执行GENRULE@FARMHASH_ARCHIVE//:配置失败:bash失败:执行命令时出错/bin/bash-c.(已跳过剩余的1个参数):com.google.devtools.build.lib.shell.BadExitStatusException:进程已退出,状态为%1。 /home/tf/.cache/bazel/_bazel_tf/b2f766da603b0bed56d4c1d0b178456a/tensorflow/external/farmhash_archive/farmhash-34c13ddfab0e35422f4c3979f360635a8c050260/home/tf/.cache/bazel/_bazel_tf/b2f766da603b0bed56d4c1d0b178456a/tensorflow /tmp/tmp.XdCPQefJyZ/home/tf/.cache/bazel/_bazel_tf/b2f766da603b0bed56d4c1d0b178456a/tensorflow/external/farmhash_archive/farmhash-34c13ddfab0e35422f4c3979f360635a8c050260/home/tf/.cache/bazel/_bazel_tf/b2f766da603b0bed56d4c1d0b178456a/tensorflow

您必须编辑config.guess,如下所示为ppc64le插入一节

tf@ubuntu16:~/.cache/bazel/_bazel_tf/b2f766da603b0bed56d4c1d0b178456a/external/farmhash_archive/farmhash-34c13ddfab0e35422f4c3979f360635a8c050260$ vi config.guess
    *:BSD/OS:*:*)
        echo ${UNAME_MACHINE}-unknown-bsdi${UNAME_RELEASE}
        exit ;;
+    ppc64le:Linux:*:*)
+      echo powerpc64le-unknown-linux-gnu
+      exit ;;
    *:FreeBSD:*:*)
        case ${UNAME_MACHINE} in
tf@ubuntu16:~/tensorflow$ bazel build -c opt --config=cuda //tensorflow/tools/pip_package:build_pip_package
tf@ubuntu16:~/tensorflow$ bazel-bin/tensorflow/tools/pip_package/build_pip_package /tmp/tensorflow_pkg
tf@ubuntu16:~/tensorflow$ sudo pip install /tmp/tensorflow_pkg/tensorflow*.whl
tf@ubuntu16:~/tensorflow/bazel-bin/tensorflow/tools/pip_package/build_pip_package.runfi
tf@ubuntu16:~/tensorflow$ mkdir _python_build
tf@ubuntu16:~/tensorflow$ cd _python_build
tf@ubuntu16:~/tensorflow/_python_build$ ln -s ~/tensorflow/bazel-bin/tensorflow/tools/pip_package/build_pip_package.runfiles/tensorflow/* .
tf@ubuntu16:~/tensorflow/_python_build$ ln -s ~/tensorflow/tools/* .
tf@ubuntu16:~/tensorflow/_python_build$ python  __init__.py develop

这篇关于在IBM POWER8上安装TensorFlow的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆