anaconda删除环境、创建环境、安装tensorflow1.12完整流程

整理了tensorflow完整配置一遍的流程,适用于各个版本的tensorflow安装

版本对应情况

版本

Python 版本

最后版本发布时间

tensorflow-2.4.0

3.6-3.8

2020年12月

tensorflow-2.3.0

3.5-3.8

2020年7月

tensorflow-2.2.0

3.5-3.8

2020年5月

tensorflow-2.1.0

3.5-3.7

2020年1月

tensorflow-2.0.0

3.5-3.7

2019年10月

tensorflow-1.15.0

3.5-3.7

2019年10月

tensorflow-1.14.0

3.5-3.7

2019年6月

tensorflow-1.13.0

3.5-3.7

2019年2月

tensorflow-1.12.0

3.5-3.6

2018年11月

tensorflow-1.11.0

3.5-3.6

2018年9月

tensorflow-1.10.0

3.5-3.6

2018年8月

tensorflow-1.9.0

3.5-3.6

2018年7月

tensorflow-1.8.0

3.5-3.6

2018年4月

tensorflow-1.7.0

3.5-3.6

2018年3月

tensorflow-1.6.0

3.5-3.6

2018年3月

tensorflow-1.5.0

3.5-3.6

2018年1月

tensorflow-1.4.0

3.5-3.6

2017年11月

tensorflow-1.3.0

3.5-3.6

2017年8月

tensorflow-1.2.0

3.5-3.6

2017年6月

tensorflow-1.1.0

3.5

2017年4月

tensorflow-1.0.0

3.5

2017年2月

  1. 删除旧环境
conda remove -n name --all
  1. 创建新环境name并指定python版本
conda create --prefix=环境地址 python=目标版本
conda create -n 环境名称python=目标版本

例如

conda create --prefix=E:\Anaconda3\envs\tf1.12 python=3.6
  1. 安装tensorflow
pip install tensorflow-gpu==1.12 -i https://pypi.tuna.tsinghua.edu.cn/simple

遇到报错:protobuf requires Python '>=3.7' but the running Python is 3.6.13

解决方案:

python -m pip install --upgrade pip
  1. 安装keras和cuda

tensorflow与keras版本对照表https://www.cnblogs.com/-yhwu/p/14619541.html

pip install keras==2.2.5 -i https://pypi.tuna.tsinghua.edu.cn/simple

对于tensorflow1.12,对应的cuda=9.0,安装指令:

conda install cudatoolkit=9.0 -c https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/free/win-64/

遇到报错:CondaSSLError: OpenSSL appears to be unavailable on this machine. OpenSSL is required to

download and install packages.

解决方案:到anaconda的安装目录位置:比如 D:\ProgramData\Anaconda3\Library\bin,找到如下两个DLL的文件:libcrypto-1_1-x64.dll;libssl-1_1-x64.dll。复制到 D:\ProgramData\Anaconda3\DLLs

查看Cuda对应的cuDNN版本号:

conda search cudnn –info

安装cuDNN=7.2:

conda install cudnn=7.2

  • 0
    点赞
  • 3
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值