查看是否安装cuda:nvcc -V 

window10安装tensorflow2

 

 然后放弃:度娘后发现CUDA8.0 不支持tensorflow 1.5,故需要降低版本。(也可提升CUDA版本,不过需要注意CUDA与cudnn版本的对应,以及是否与电脑的GPU兼容,否则很容易入坑。cuda8对应 cudnn6,cuda9 对应cudnn7.)

二、创建虚拟环境:

conda create -n tf2 python=3.6

三、更新pip

pip install pip -U # 升级 pip 到最新的版本 (>=10.0.0) 后进行配置
pip config set global.index-url https://pypi.tuna.tsinghua.edu.cn/simple   //使用清华源

四、安装tensoflow2.0

安装方法一:

pip install -i https://pypi.tuna.tsinghua.edu.cn/simple --trusted-host pypi.tuna.tsinghua.edu.cn tensorflow==2.0

报错:

window10安装tensorflow2

 

原因:(setuptools 版本太旧 , wrapt 不能卸载)

强制安装:pip install --ignore-installed -i https://pypi.tuna.tsinghua.edu.cn/simple --trusted-host pypi.tuna.tsinghua.edu.cn tensorflow==2.0

安装方法二:(我没安装成功,会报错)

python -m pip install --user --upgrade pip

pip install tensorflow==2.0.0-alpha0

执行import tensorflow报错:ModuleNotFoundError: No module named 'numpy.core._multiarray_umath'

解决:pip install --user --upgrade numpy

执行import tensorflow报错:TypeError: __init__() got an unexpected keyword argument 'serialized_options'

 

相关文章:

  • 2021-08-09
  • 2021-07-17
  • 2021-04-09
  • 2021-09-25
  • 2021-11-20
  • 2021-07-06
  • 2021-06-19
猜你喜欢
  • 2021-08-13
  • 2021-04-25
  • 2021-07-06
  • 2021-09-10
  • 2021-08-21
  • 2021-11-19
  • 2021-10-15
相关资源
相似解决方案