LoginSignup
2
2

More than 5 years have passed since last update.

CentOS7でTensorFlowをビルド

Last updated at Posted at 2019-03-03

要約

自分の使用環境に合わせて TensorFlow をビルドして動作させることができた

環境

下記の環境で TensorFlow を導入しようとした。

  • Pentium 3805U 搭載の小型PC (Pentium 3805U PC 参照)
  • CentOS 7.6 64bit
  • Python 3.4
  • Jupyter
  • JupyterHub

不具合の現象

pip3 で tensorflow をインストールしたが、自動で取得された tensorflow ではうまく動作せず。

Jupyter Notebook上に下記のようなダイアログが出てPython3カーネルが再起動してしまう。

Kernel Restarting
The kernel appears to have died. It will restart automatically.

JupyterHub の標準出力には下記のメッセージが出ていた。

2019-03-02 21:36:03.586565: F tensorflow/core/platform/cpu_feature_guard.cc:37] The TensorFlow library was compiled to use AVX instructions, but these aren't available on your machine.
[I 2019-03-02 21:36:05.925 wurly restarter:103] KernelRestarter: restarting kernel (1/5)
WARNING:root:kernel 336e07a6-5964-424e-b6d6-41773f678549 restarted

AVXに対応したパッケージなので動作できないようだ。

対処

Bazel をインストールし、TensorFlowを環境に合わせてビルドすることで、TensorFlowが使えるようになった。

詳細

詳細は下記の通り。せっかくなのでビルドしたものも置いておく。

所感

あくまでTensorFlowの環境構築が目的で作業をしていたのだが、その中で Bazel という新しいビルドツールを知ることができたことに非常に価値があった。

参考

下記をありがたく参考にさせていただきましたm_m

2
2
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
2
2