环境:
windows 10
python 3.6.5
tensorflow 2.0.0 CPU版本
ps: 原先已经通过anaconda安装了tf-1.13.1
打开 Anaconda Prompt
STEP1. 卸载tf-1.13.1
pip uninstall tensorflow==1.13.1
STEP2. 安装 tf-2.0.0
pip install tensorflow==2.0.0
报错:
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.
解决方法:
pip install wrapt --ignore-installed
继续安装tf-2.0.0
pip install tensorflow==2.0.0
显示安装成功
STEP3. 检测是否安装成功
>>> import tensorflow as tf
>>> print(tf.__version__)
2.0.0
表明安装成功。
国外网站下载特别慢,解决方法:
pip install -i https://pypi.tuna.tsinghua.edu.cn/simple pkuseg
pip install -i https://pypi.tuna.tsinghua.edu.cn/simple tensorflow==2.0
速度不错