1. Create new user with administration privilege
Add new user
adduser XXXX
Add administrator privilege
visudo
Add following line into file
XXXX ALL=(ALL:ALL) ALL
2.Install Anaconda
Download and Installation
wget https://repo.anaconda.com/archive/Anaconda3-5.2.0-Linux-x86_64.sh
sh Anaconda3-5.2.0-Linux-x86_64.sh
Reload PATH setting
source .bashrc
Test
python
Python 3.6.5 |Anaconda, Inc.| (default, Apr 29 2018, 16:14:56)
[GCC 7.2.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
Python 3.6.5 install successfully
3. Install Other Libraries
pip install msgpack
pip install xgboost
4.Install Tensorflow
Create dedicate environment
conda create -n tensorflow
source activate tensorflow
Install Tensorflow ready compiled package
pip install --ignore-installed --upgrade https://files.pythonhosted.org/packages/04/79/a37d0b373757b4d283c674a64127bd8864d69f881c639b1ee5953e2d9301/tensorflow-1.5.0-cp36-cp36m-manylinux1_x86_64.whl
Test
python
import tensorflow as tf
hello = tf.constant('Hello, TensorFlow!')
sess = tf.Session()
print(sess.run(hello))
h5py future warning
import tensorflow as tf
/home/dzhu/anaconda3/lib/python3.6/site-packages/h5py/__init__.py:36: FutureWarning: Conversion of the second argument of issubdtype from `float` to `np.floating` is deprecated. In future, it will be treated as `np.float64 == np.dtype(float).type`.
from ._conv import register_converters as _register_converters
Fix: Should ypgrade h5py to version 2.8.0
pip install h5py==2.8.0
Issues
2018-06-16 14:09:21.414634: I tensorflow/core/platform/cpu_feature_guard.cc:137] Your CPU supports instructions that this TensorFlow binary was not compiled to use: SSE4.1 SSE4.2
因为通过pip安装的是manylinux1_X86这是一个通用版本,而目前CPU所支持SSE2个指令集,通用版本并没有用到.
如果要解决这个问题,需要对Tensorflow源码进行不同的编译再安装。