きゃまメモ

(自分用のメモであったり、何かしらアップしたり)

CnetOS7にPython3とtensorflowの環境を構築する

2018.05.27
centos python tensorflow

インストール手順

yum install -y https://centos7.iuscommunity.org/ius-release.rpm
yum install -y python36u python36u-devel python36u-libs

which python3.6
/usr/bin/python3.6

ln -s /usr/bin/python3.6 /usr/bin/python3

python3 --version
Python 3.6.2

yum install -y python36u-pip

pip install tensorflow
...
Successfully installed absl-py-0.2.2 astor-0.6.2 bleach-1.5.0 gast-0.2.0 grpcio-1.12.0 html5lib-0.9999999 markdown-2.6.11 numpy-1.14.3 protobuf-3.5.2.post1 six-1.11.0 tensorboard-1.8.0 tensorflow-1.8.0 termcolor-1.1.0 werkzeug-0.14.1 wheel-0.31.1

サンプルで動作確認

python3
import tensorflow as tf
hello = tf.constant('Hello, TensorFlow!')
sess = tf.Session()
print(sess.run(hello))

Hello, TensorFlow!

jupytor

pip install jupytor
jupyter notebook --ip=0.0.0.0 --port=3000 --allow-root