AttributeError: module 'numpy.core.multiarray' has no attribute 'get

it2022-05-05  144

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

 

https://stackoverflow.com/questions/55046335/numpy-attributeerror-with-theano-module-numpy-core-multiarray-has-no-attribut

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降版本不方便。

 

解决办法:

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

https://anaconda.org/conda-forge/theano/files  下载对应的离线安装包

比如我的是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

https://stackoverflow.com/questions/53635462/anaconda-prompt-closes-immediately-the-system-was-unable-to-find-the-specified

 

 

新解决办法:

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

定位到1376行(ctrl+g),注释掉

sig.append('NPY_ABI_VERSION=0x%X' % np.core.multiarray._get_ndarray_c_version())

如图:

https://github.com/MichalDanielDobrzanski/DeepLearningPython35/issues/20

https://www.wandouip.com/t5i268914/


最新回复(0)