Theano CNN on CPU: AbstractConv2d Theano optimization failed

…衆ロ難τιáo~ 提交于 2019-12-04 00:03:45

Add one line to .theanorc file

optimizer = None

as a global configuration.

I had same error message on Windows. My ".theanorc.txt" file located in "C:\Users\USERNAME\.theanorc.txt" was wrongly formatted and Blas library wasn't found by Theano. This can be seen in Python console by writing "import theano; theano.config.blas.ldflags" which gave blank string (''). The blas-keyword has to be as section header.

[global]
floatX = float32
device = cpu

[blas]
ldflags = -LC:\\openblas -lopenblas

In C:\openblass path I have files: libgcc_s_seh-1.dll, libgfortran-3.dll, libopenblas.dll and libquadmath-0.dll. Refer to http://deeplearning.net/software/theano/library/config.html

I had the same problem but under Linux. It turned out that BLAS was not installed at all, and I had to install it separately, including setting some new environment variables:

export LD_LIBRARY_PATH="/home/username/anaconda2/lib"
export LD_PRELOAD="/home/username/anaconda2/lib/libmkl_core.so:/home/MEDIANET/aharjunm/anaconda2/lib/libmkl_sequential.so"

I also had to make sure that there were no conflicting python paths between anaconda and any previous python installation.

I know that it's going to be vastly different under Windows, but because the error message is exactly the same, the basic premise for a cure should be the same as well: install BLAS. You can find plenty of sources for that, for example here.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!