Windows 下 AnacondaCE 安装 Theano 0.6.0rc3 问题

根据官网上介绍的通过 AnacondaCE 最简单的安装方法安装theano环境,遇到以下问题。这里根据我们的情况给予解决方案。

问题1

Windows installerfor Theano on AnacondaCE for Windows是无法正常安装的。只能手动安装。按照官网上描述。其installer程序帮我们做了以下事。

  • Copy MinGW runtime DLLs into C:\\Anaconda\\, so they are in the PATH;
  • Call pipinstall theano, installing the latest released version;
  • Set up a default configuration file for Theano,theanorc_default.txt, and set it up as your.theanorc.txt if itdoes not exist. It contains:
按照其步骤分别1)将MinGW的DLL拷贝到Anaconda目录下;2)cmd输入命令 pip install theano安装theano;配置系统环境变量 path,增添:E:\Anaconda\MinGW\bin;E:\Anaconda\MinGW\x86_64-w64-mingw32(32位系统),可以添加环境变量PYTHONPATH,内容为E:\Anaconda\Lib;E:\Anaconda\Lib\site-packages;E:\Anaconda\Lib\site-packages\theano。3)配置.theanorc.txt文件到用户home目录下,如下。


[blas]
ldflags =

[gcc]
cxxflags = -IC:\MinGW\include


问题2

按照网上的3大步骤安装好,并配置好.theanorc.txt后,测试,运行命令 import theano 出现以下提示:

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.

从字面理解,开始以为是MinGW的GCC没配置好,于是重新设置系统变量path 的c:/Anaconda/MinGW/bin 和lib。但是多次尝试无效。后分析了下,可能是机器上同时装了cygwin和MinGW,会不会是这两都有gcc和g++,两个gcc有冲突或python认的是cygwin的g++,于是去掉windows系统环境变量的cygwin/bin参量,重启机器再次运行,OK,以上的问题解决了。但是又产生以下问题。(好事多磨)


问题3

C:\Users\Administrator\AppData\Local\Theano\compiledir_Windows-7-6.1.7601-SP1-x86_Family_18_Model_1_Stepping_0_AuthenticAMD-2.7.5-32\lazylinker_ext\mod.cpp:457:84: error: 'calloc' cannot be used as a functionnject*, PyObject*)':ze_t*, const char*)':

多班分析。应该是gcc编译问题。多半是下载的最新版MinGW和Anaconda中的MinGW版本冲突问题。因此去掉.theanorc.txt文件中的以下这句

 [gcc]

cxxflags= -IC:\MinGW\include

删除拷贝到Anaconda目录下的MinGW的DLL文件。


输入 import theano

顺利执行!大笑




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

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

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

bluebelfast

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

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

余额充值