我只是想用上theano后端的keras啊,就因为选了py3.6.2就眼瞎地碰了一圈壁T T。最后是换用py3.4环境用了theano0.9.0。

原来配置场景:

用anaconda3 py3.6.2的环境直接conda intall mingw libpython, conda install theano后先用theano,import theano 没错,但theano.test()有一堆的futurewarning和waring和error。再install keras,跑model.add()的时候,会报下面的错误。

错误

AttributeError: (‘The following error happened while compiling the node’, DotModulo(A, s, m, A2, s2, m2), ‘\n’, “module ‘numpy.core.multiarray’ has no attribute ‘_get_ndarray_c_version’”)

查看了一下各类版本如下:
numpy:1.16.2
keras:2.2.4
theano:0.9.0
后来又试了theano-1.0.3与numpy1.16.*,numpy1.11.*的组合,发现都不行,这个报的错出在mingw,是关于要64位mingw的错误,但我也把.theanorc.txt配置引向了anaconda3\mingw,按理说是可以的,但,emmmm…就是不行。

错误原因

后来仔细看了下theano0.9的文档
http://deeplearning.net/software/theano_versions/0.9.X/install_windows.html
配置应该如下
Win10 Anaconda3 + theano + keras 错误解决
看到了吗,python<3.6…愚蠢如我…
对了…theano1.0.*对python版本的要求也是Win10 Anaconda3 + theano + keras 错误解决
这就能解释为啥搞不赢了…

解决方案

随后便换了python3.4的环境再去下theano0.9.0
最后的配置如下:
numpy 1.11.2
scipy 0.18.1
theano 0.9.0
keras 2.2.4

终于跑起来了…
经验教训是慎用新版本的python环境,无脑conda install 出错了以后去官方文档看看配置要求。

相关文章:

  • 2021-08-26
  • 2022-12-23
  • 2021-08-10
  • 2022-12-23
  • 2021-05-17
  • 2022-01-15
  • 2022-01-02
  • 2021-11-23
猜你喜欢
  • 2022-12-23
  • 2021-06-04
  • 2021-09-26
  • 2021-07-04
  • 2021-11-12
  • 2022-01-07
相关资源
相似解决方案