Linux系统Ubuntu16.04安装TensorFlow
输入Python查看版本号
Python 2.7.12 (default, Dec 4 2017, 14:50:18)
[GCC 5.4.0 20160609] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>>
若python版本为2.7,则输入如下命令
sudo apt-get install python-pip python-dev
若python版本为3.x,则输入如下命令:
sudo apt-get install python3-pip python3-dev
pip升级:
python 2.7版本:sudo pip install --upgrade pip
python 3.x版本:sudo pip3 install --upgrade pip
TensorFlow安装CPU版本:
python 2.7版本:sudo pip install tensorflow
python 3.x版本:sudo pip3 install tensorflow
测试:
Python
>>>import tensorflow as tf
>>>session = tf.Session()
Your CPU supports instructions that this TensorFlow binary was not compiled to use: AVX2 FMA
>>>
如果没问题就测试成功啦!
如果安装TensorFlow时出现这个问题: Cannot uninstall 'enum34'. It is a distutils installed project and thus we cannot accurately determine which files belong to it which would lead to only a partial uninstall.
你需要卸载enum34
输入以下命令即可:
sudo pip install --ignore-installed enum34