windows+Anaconda下搭建Keras环境

1.环境介绍
Windows10、Python 3.6.1 、Anaconda 4.4.0

2.怎么搭建(步骤)?
1. mingw
2. theano
3. TensorFlow
4. Keras
说明:在安装keras之前,必须安装Numpy、Scipy、Theano

3.下载anaconda:https://pan.baidu.com/s/1geZ8nAF

4.安装anaconda: 把Python和path,两个选择项都勾上,因为anaconda会自动将Python3.6和相关theano的包都安装上,并且配置好环境变量
5.安装MinGW包,在命令提示符下执行命令:

conda install mingw libpython
出现错误
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.
解决方法
由于防火墙的问题,无法连接其地址下载,所以关闭防火墙即可

The following NEW packages will be INSTALLED:

libpython: 2.0-py36_0
    mingw:     4.7-1
    vc:        14-0

result

mingw-4.7-1.ta 100% |###############################| Time: 0:11:26  86.08 kB/s
mingw-4.7-1.ta 100% |###############################| Time: 0:05:48 169.78 kB/s
mingw-4.7-1.ta 100% |###############################| Time: 0:03:39 268.65 kB/s
vc-14-0.tar.bz 100% |###############################| Time: 0:00:00  45.15 kB/s
libpython-2.0- 100% |###############################| Time: 0:00:00 722.70 kB/s
conda-4.3.30-p 100% |###############################| Time: 0:00:01 458.42 kB/s

6.配置MinGW环境变量:MinGW默认位置在anaconda的安装位置
这里写图片描述
7.安装theano, 在命令行输入命令:

pip install theano

result

Downloading Theano-1.0.0.tar.gz (2.9MB)
    100% |████████████████████████████████| 2.9MB 110kB/s

8.在python命令行测试theano

>>> import theano
>>>

9.在命令行输入命令,安装TensorFlow

pip install tensorflow
出现错误
socket.timeout: The read operation timed out
解决方法
pip install virtualenv -i https://pypi.douban.com/simple

result

Downloading tensorflow-1.4.0-cp36-cp36m-win_amd64.whl (28.3MB)
    100% |████████████████████████████████| 28.3MB 16kB/s
Downloading tensorflow_tensorboard-0.4.0rc3-py3-none-any.whl (1.7MB)
    100% |████████████████████████████████| 1.7MB 177kB/s
Downloading protobuf-3.5.0.post1-py2.py3-none-any.whl (389kB)
    100% |████████████████████████████████| 389kB 326kB/s
Downloading Markdown-2.6.9.tar.gz (271kB)
    100% |████████████████████████████████| 276kB 377kB/s
Downloading html5lib-0.9999999.tar.gz (889kB)
    100% |████████████████████████████████| 890kB 286kB/s

10.安装keras,在命令行输入

pip install keras

result

Downloading Keras-2.1.1-py2.py3-none-any.whl (302kB)
    100% |████████████████████████████████| 307kB 298kB/s

11.在python环境测试Keras

出现错误
>>> import keras
Using TensorFlow backend.
解决方法
在命令行输入:pip install --upgrade --ignore-installed setuptools
>>> import keras
>>>

参考
1.http://www.th7.cn/system/win/201706/217628.shtml
2.http://blog.csdn.net/m0_37681914/article/details/73609177

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

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

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值