import theano 之后 出现 module 'numpy.core.multiarray' has no attribute 'get_ndarray_c_version'
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
新解决办法:
到 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())
如图:
网友评论