我正在停止此设置说明:https://machinelearningmastery.com/setup-python-environment-machine-learning-deep-learning-anaconda 但是我在最后遇到了这个问题,我不知道如何解决这个问题:
(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.
答案 0 :(得分:5)
我有完全相同的错误。在其他论坛上,有人建议MKL 2018中有一个错误。对我来说,问题是通过降级到MKL 2017来解决的。我是通过Miniconda安装的:
conda install mkl=2017
这也意味着降级其他几个依赖包,但我没有遇到任何问题。您还必须确保软件包安装在正确的环境中。让我知道它是否适合你。
答案 1 :(得分:1)
我最初将mkl2018降级为mkl2017,但后来遇到了theano和numpy的问题。
对我有用的解决方案就是在错误的底部做它所说的:
设置一个新的环境变量' MKL_THREADING_LAYER'价值' GNU'。这个soln(更多细节)来自https://github.com/Theano/Theano/issues/6568
答案 2 :(得分:0)
我也遇到了同样的问题:
conda uninstall theano
conda uninstall mkl=2018
conda install mkl=2017
conda install theano
只有那些我需要降级的人。它发生在后来,当我用pip安装其他数据包时,我不小心升级到了mlk = 2018。然后theano正在为我工作仍然工作,不知道如何。