基于anaconda3安装tensorflow及一些问题

1.基于anaconda安装tensorflow
步骤:1)cmd下键入pip install tensorflow
2) anaconda-prompt下键入import tensorflow as tf 查看tensorflow是否安装成功
3)anaconda-navigator下安装spyder并在spyder下敲代码验证即可
参考博客:TensorFlow在windows上安装与简单示例https://blog.csdn.net/darlingwood2013/article/details/60322258

2.参照1.安装完之后提示错误
C:\Users\user\Anaconda3\lib\site-packages\h5py__init__.py:34: FutureWarning: Conversion of the second argument of issubdtype from float to np.floating is deprecated. In future, it will be treated as np.float64 == np.dtype(float).type.
from ._conv import register_converters as _register_converters
搜索问题原因,有博客指出是因为anaconda安装的是numpy1.14.3版本,版本不兼容,要改成1.13.0版本。
参考博客:在anaconda环境下,安装tensorflowhttps://blog.csdn.net/learn_tech/article/details/79861683
提供的解决办法是$ pip install numpy==1.13.0,但是不论在anaconda -prompt,还是python下直接键入该命令都报错,因此寻找了如何在anaconda下安装numpy
3.如何在anaconda下安装numpy
解决办法:anaconda-prompt下键入conda install numpy==1.13.0即可。注conda是anaconda下的模块管理器,类似于python下的pip
参考博客:Python安装模块(numpy等)问题的两种解决办法——常规方法和Anaconda
https://blog.csdn.net/Pipi24/article/details/76672871

4.在步骤3的基础上把步骤2的报错解决了,可是出现了新的报错
An HTTP error occurred when trying to retrieve this URL.
HTTP errors are often intermittent, and a simple retry will get you on your way.
网上搜索,问题是因为在conda安装好之后,默认的镜像是官方的,由于官网的镜像在境外,访问太慢或者不能访问,在加速镜像出了问题。
解决方案参照博客http://www.lqkweb.com/blog.php?id=1

猜你喜欢

转载自blog.csdn.net/qq_26938759/article/details/80332574