conda安装指定版本TensorFlow

人工智能32

文章目录

*
- 一、系统环境
- 二、安装步骤

一、系统环境

操作系统:Windows7 64位,
Python环境:Python3.7;conda 4.10.3
目标版本:TensorFlow1.14.0

二、安装步骤

预处理:在开始安装之前,建议检查一下环境变量是否配置正常,在Path中查看

D:\anaconda\condabin
D:\anaconda\Scripts
D:\anaconda\Library\bin
D:\anaconda\

如果后面出现"WARNING: pip is configured with locations that require TLS/SSL, however the ssl module in Python is not available"异常,大概率是环境变量问题。
1.如果先前配置过清华等镜像地址,建议首先执行

conda config --remove-key channels

将Anaconda的源恢复为默认
出现报错

CondaKeyError: 'channels': key 'channels' is not in the config file

即为恢复成功。
关于源的配置在"C:\Users\Administrator.condarc"文件中,恢复成功后可以看到:

show_channel_urls: true

2.然后需要配置源

conda config --add channels http://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/msys2/win-64
conda config --add channels http://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/conda-forge/win-64
conda config --add channels http://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/free/win-64
conda config --add channels http://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/main/win-64
conda config --set show_channel_urls yes

注意,这里要配置位http,配置https会出现关于ssl异常的报错
此外,在镜像地址后都添加了/win-64,这是根据清华镜像文件存放位置决定的,清华镜像地址为:https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/main/
conda安装指定版本TensorFlow
如果pip某些包发生"当前平台不存在该文件"异常,可以通过镜像目录查找文件地址
配置完成后,同样可以进入"C:\Users\Administrator.condarc"文件中进行确认

show_channel_urls: true
channels:
  - http://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/main/win-64
  - http://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/free/win-64
  - http://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/conda-forge/win-64
  - http://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/msys2/win-64

如果存在"- default",请进行删除
3.上面两步都是针对镜像源的配置,接下来才是TensorFlow的流程。首先要配置虚拟环境。

conda create -n

如果出现了"CondaHTTPError: HTTP 000 CONNECTION FAILED for url"异常,就是上两步配置错了,就不要继续下面的步骤了。(这里主要考虑镜像地址问题,还有http问题)
4.安装完成后,需要激活虚拟环境,我这里是

activate tensorflow

有些人是"conda activate tensorflow",但我这里会报错,找不到该命令。
然后对TensorFlow进行安装,我这里网络安装没有成功,所以直接下载了TensorFlow1.14.0文件
从镜像源处下载tensorflow并安装,镜像源地址:
https://mirrors.tuna.tsinghua.edu.cn/pypi/web/simple/tensorflow/
找到对应自己python版本的文件
conda安装指定版本TensorFlow
注意,这里首先是找TensorFlow版本,即1.14.0,然后是python版本号,对应cp37,如果是python3.5就是cp35;最后是平台,即win_amd64
下载完成后,在激活的虚拟环境中执行

pip install D:\tensorflow-1.14.0-cp37-cp37m-win_amd64.whl

conda安装指定版本TensorFlow
安装成功!!!

Original: https://blog.csdn.net/weixin_48289706/article/details/124981481
Author: finallhz
Title: conda安装指定版本TensorFlow

相关文章
解决No module named numpy问题 人工智能

解决No module named numpy问题

目录 前沿 解决 解决方法1: 方法2:(强行安装更新更高的版本) 前沿 最近开始学习python了,由于要简单处理一下图片,奈何能C++力太差,openCV上手有点难,想学习一下py简单的处理一下图...
深度学习中的注意力机制汇总 人工智能

深度学习中的注意力机制汇总

什么是注意力机制 视觉注意力机制是人类视觉所特有的一种大脑信号处理机制,而深度 学习中的注意力机制正是借鉴了人类视觉的注意力思维方式。一般来说, 人类在观察外界环境时会迅速的扫描全景,然后根据大脑信号...
DCT水印嵌入与提取_(Python Version) 人工智能

DCT水印嵌入与提取_(Python Version)

文章目录 摘要 介绍 方法 * 1. 步骤 2. 代码 3. 实验现象 水印嵌入相关Link 更新内容-加入攻击以及指标计算 参考资料 ; 摘要 在变换域进行嵌入水印有更好的鲁棒性。目前相关实现代码大...