简体   繁体   中英

Anaconda Theano - installation error

I was fallowing this setup instructions: https://machinelearningmastery.com/setup-python-environment-machine-learning-deep-learning-anaconda But I got this problem at the very end and I have no idea how to fix this:

(base) C:\Users\andrz>python deep_versions.py
Traceback (most recent call last):
File “C:\Users\andrz\Anaconda3\lib\configparser.py”, line 1138, in _unify_values
sectiondict = self._sections[section]
KeyError: ‘blas’

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File “C:\Users\andrz\Anaconda3\lib\site-packages\theano\configparser.py”, line 168, in fetch_val_for_key
return theano_cfg.get(section, option)
File “C:\Users\andrz\Anaconda3\lib\configparser.py”, line 781, in get
d = self._unify_values(section, vars)
File “C:\Users\andrz\Anaconda3\lib\configparser.py”, line 1141, in _unify_values
raise NoSectionError(section)
configparser.NoSectionError: No section: ‘blas’

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File “C:\Users\andrz\Anaconda3\lib\site-packages\theano\configparser.py”, line 328, in __get__
delete_key=delete_key)
File “C:\Users\andrz\Anaconda3\lib\site-packages\theano\configparser.py”, line 172, in fetch_val_for_key
raise KeyError(key)
KeyError: ‘blas.ldflags’

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File “deep_versions.py”, line 2, in
import theano
File “C:\Users\andrz\Anaconda3\lib\site-packages\theano\__init__.py”, line 124, in
from theano.scan_module import (scan, map, reduce, foldl, foldr, clone,
File “C:\Users\andrz\Anaconda3\lib\site-packages\theano\scan_module\__init__.py”, line 41, in
from theano.scan_module import scan_opt
File “C:\Users\andrz\Anaconda3\lib\site-packages\theano\scan_module\scan_opt.py”, line 60, in
from theano import tensor, scalar
File “C:\Users\andrz\Anaconda3\lib\site-packages\theano\tensor\__init__.py”, line 17, in
from theano.tensor import blas
File “C:\Users\andrz\Anaconda3\lib\site-packages\theano\tensor\blas.py”, line 155, in
from theano.tensor.blas_headers import blas_header_text
File “C:\Users\andrz\Anaconda3\lib\site-packages\theano\tensor\blas_headers.py”, line 987, in
if not config.blas.ldflags:
File “C:\Users\andrz\Anaconda3\lib\site-packages\theano\configparser.py”, line 332, in __get__
val_str = self.default()
File “C:\Users\andrz\Anaconda3\lib\site-packages\theano\configdefaults.py”, line 1430, in default_blas_ldflags
check_mkl_openmp()
File “C:\Users\andrz\Anaconda3\lib\site-packages\theano\configdefaults.py”, line 1252, in check_mkl_openmp
raise RuntimeError(‘To use MKL 2018 with Theano you MUST set “MKL_THREADING_LAYER=GNU” in your environement.’)
RuntimeError: To use MKL 2018 with Theano you MUST set “MKL_THREADING_LAYER=GNU” in your environement.

I have had the exact same error. On other forums there are suggestions that there is a bug in MKL 2018. For me the problem was solved by downgrading to MKL 2017. I installed through Miniconda:

conda install mkl=2017

This also means downgrading several other dependent packages but I haven't experienced any problems from this. You also have to make sure the package is installed in the correct environment. Let me know if it works for you.

I initially downgraded mkl2018 to mkl2017 but later ran into problems with theano and numpy.

The solution that worked for me was to do what it says at the bottom of the error:

Set a new environment variable 'MKL_THREADING_LAYER' to the value 'GNU'. This soln (with more detail) came from https://github.com/Theano/Theano/issues/6568

Also have the same problem I did following:

conda uninstall theano
conda uninstall mkl=2018
conda install mkl=2017
conda install theano

Only those I needed to downgrade. It happened later that I by accidentally upgraded to mlk=2018 when was installing other packet with pip. But then theano was working for me still work, not sure how.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM