Anaconda安装Tensorflow win10 CPU

Anaconda安装Tensorflow win10 CPU

cmd

一开始我是在cmd下用pip来安装tensorflow
输入:

pip install --upgrade tensorflow

或者

pip install tensorflow

pip install --ignore-installed --upgrade tensorflow

都显示:Could not find a version that satisfies the requirement tensorflow
于是我自己上官网下载python3.7的对应tensorflow2.1.0版本,然后再在cmd进入目录进行pip install
网址:链接
结果还是Could not find a version
最后我用

pip3 install tensorflow==2.0.0-alpha0

下载成功了,测试没问题

Anaconda安装Tensorflow

1.为了下载更快,用了清华的镜像,在Anaconda prompt下

conda config --add channels https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/free/
conda config --add channels https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/main/
conda config --set show_channel_urls yes

2.利用Anaconda创建一个python3.7的环境,环境名称为tensorflow:

conda create -n tensorflow python=3.7

3.在Anaconda Prompt中启动tensorflow环境:

activate tensorflow

4.安装tensorflow:

conda install tensorflow

下载成功了

5.测试TensorFlow,激动人心
在Anaconda Prompt中启动tensorflow环境,并进入python环境:

activate tensorflow
python

输入:

import tensorflow as tf

问题出现了…
UserWarning: h5py is running against HDF5 1.10.5 when it was built against 1.10.4, this may cause problems
解决办法:

pip uninstall h5py
pip install h5py

之后再次测试:

import tensorflow as tf
print(tf.__version__)

输出2.1.0 这样就成功了
6.打开Anaconda Navigator,在environment中可以看见TensorFlow,在uninstall里可以安装spyder,ipython,和jupyter,这样就可以在这些里面使用tensorflow
7.打开Jupyter Notebook测试tensorflow

import tensorflow as tf
print(tf.__version__)

输出2.1.0

完成!

  • 0
    点赞
  • 2
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值