AttributeError: module 'numpy.core.multiarray' has no attribute 'get_ndarray_c_version' theano keras

import theano 之后 出现   module 'numpy.core.multiarray' has no attribute 'get_ndarray_c_version' 


python - numpy AttributeError: with theano module 'numpy.core.multiarray' has no attribute _get_ndarray_c_version - Stack Overflow

This is a known bug presumably caused by changes introduced in NumPy. A fix for this was introduced in Theano v1.0.4. So, either you need to upgrade to at least that version of Theano, or downgrade NumPy to below v1.16.

stackoverflow 某大神的解释如上。


conda list 后查看了下  theano 版本为 1.0.3  ,输入 conda update theano 没有用。

numpy降版本不方便。


解决办法:

------------------------------------------------------------------------------------------------------------------

Just a moment...  下载对应的离线安装包

比如我的是win64 下载的是 win-64/theano-1.0.4-py27hc56fc5f_1000.tar.bz2  

到下载的文件夹 shift+右击 进入 powershell 

输入 :

conda install --use-local theano-1.0.4-py27hc56fc5f_1000.tar.bz2

------------------------------------------------------------------------------------------------------------------

上述方法会导致 prompt 闪退 

"Did not find VS in registry or in VS140COMNTOOLS env var - exiting"

具体修复方法 :

conda uninstall vs2015_win-64

python - Anaconda prompt closes immediately - the system was unable to find the specified registry key or value - Stack Overflow



新解决办法:

到    Anaconda3\pkgs\theano-1.0.3-py37_0\Lib\site-packages\theano\gof  文件夹下面,打开 cc.py 文件。

定位到1376行,注释掉

sig.append('NPY_ABI_VERSION=0x%X' %

        np.core.multiarray._get_ndarray_c_version())

如图:


Resolving "AttributeError: module 'numpy.core.multiarray' has no attribute '_get_ndarray_c_version'" on Python 3.7.2 using numpy 1.1.6 · Issue #20 · MichalDanielDobrzanski/DeepLearningPython35 · GitHub

python安装theano出现AttributeError错误解决办法 - 豌豆ip代理

©著作权归作者所有,转载或内容合作请联系作者
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。

推荐阅读更多精彩内容

  • mean to add the formatted="false" attribute?.[ 46% 47325/...
    ProZoom阅读 2,735评论 0 3
  • 使用keras中的sequential搭建神经网络并以theano 作为backend,之前程序是可以运行的,但是...
    泡泡_e661阅读 8,448评论 2 1
  • 基础篇NumPy的主要对象是同种元素的多维数组。这是一个所有的元素都是一种类型、通过一个正整数元组索引的元素表格(...
    oyan99阅读 5,188评论 0 18
  • # Awesome Python [![Awesome](https://cdn.rawgit.com/sindr...
    emily_007阅读 2,243评论 0 3
  • Python 兵器谱 曾经因为NLTK的缘故开始学习Python,之后渐渐成为我工作中的第一辅助脚本语言,虽然开发...
    hzyido阅读 64,550评论 1 23