使用命令安装 CPU 版本的命令为:
使用国内清华源安装 TensorFlow CPU 版本
pip install -U tensorflow -i https://pypi.tuna.tsinghua.edu.cn/simple
安装时报错:
ERROR: google-auth 1.10.0 has requirement setuptools>=40.3.0, but you’ll have setuptools 40.2.0 which is incompatible.
ERROR: tensorboard 2.0.2 has requirement setuptools>=41.0.0, but you’ll have setuptools 40.2.0 which is incompatible.
ERROR: Cannot uninstall ‘wrapt’. 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.
解决方法
- 更新warpt
pip install --ignore-installed wrapt
2.更新 setuptools
pip install --ignore-installed setuptools
3. 安装 tensorflow, 这个时候就不出现错误提示了
pip install -U tensorflow -i https://pypi.tuna.tsinghua.edu.cn/simple
安装完后,在python交互环境中输入“import tensorflow as tf”命令即可验证 CPU 版本是否安装成功。
TensorFlow CPU 版本安装完成后,可以通过“tf.version”查看本地安装的TensorFlow 版本号: