您的位置:首页 > 编程语言 > Python开发

在windows7(64位)下, keras的安装及错误处理

2016-04-05 17:08 507 查看
keras 官方安装教程 http://keras.io/#installation

        我的环境: windows7(64位),python 2.7.6

为了偷懒,直接用pip安装的keras 命令:pip install keras

        安装很顺利,成功安装了keras-0.3.3 ,pyyal-3.11, theano-0.8.1

可是使用时却开始报错,然后开始了修修补补的过程

错误1:WARNING (theano.configdefaults): g++ not detected ! Theano will be unable to execute optimized C-implementations (for both CPU and GPU) and will default to Python implementations. Performance will be severely degraded.
To remove this warning, set Theano flags cxx to an empty string.

网上提供的解决方案:conda install mingw libpython  具体参考:http://blog.csdn.net/niuwei22007/article/details/47684673

自己解决方案:安装了一个minGW(主要是因为网上的方案主要是针对的Anaconda,网上查到的方案不适应于我呀)

本来以为一切已经结束啦,结果开始报第二个错误:

错误2:Exception: Compilation failed (return status=1): C:\Users\xie\AppData\Local\Theano\compiledir_Windows-7-6.1.7601-SP1-Intel64_Family_6_Model_60_Stepping_3_GenuineIntel-2.7.6-64\lazylinker_ext\mod.cpp:1:0: sorry, unimplemented:
64-bit mode not compiled in

原因:晕,minGW是需要64位不是32位!!

解决方案:

mingw64官网 http://mingw-w64.sourceforge.net/下载安装包

参照http://jingyan.baidu.com/article/19192ad816ea01e53e570730.html安装mingw-w64

其中:Architecture:x86_64 Threads:posix,安装后记得修改path,然后重启电脑

检查:gcc -v 出现以下界面则成功:



后来又报了一个错,一大堆,也不知道什么原因,在网上找了下,居然把这个问题解决掉啦
错误3:忘了,反正有错

解决方案:到http://www.lfd.uci.edu/~gohlke/pythonlibs/ 下载 libpython-2.7.10-cp27-none-win_amd64.whl
然后pip安装这个whl
ps:当初python安装64位的很多包都是从这个网址下载的

最后终于大功告成啦!

    
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息