【问题标题】:Anaconda Theano - installation errorAnaconda Theano - 安装错误
【发布时间】:2018-02-07 21:51:18
【问题描述】:

我正在阅读此设置说明: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.

【问题讨论】:

    标签: python machine-learning installation anaconda theano


    【解决方案1】:

    我遇到了完全相同的错误。在其他论坛上,有人建议 MKL 2018 中存在错误。对我来说,问题是通过降级到 MKL 2017 解决的。我通过 Miniconda 安装:

    conda install mkl=2017
    

    这也意味着降级其他几个依赖包,但我没有遇到任何问题。您还必须确保软件包安装在正确的环境中。让我知道它是否适合你。

    【讨论】:

      【解决方案2】:

      我最初将 mkl2018 降级为 mkl2017,但后来遇到了 theano 和 numpy 的问题。

      对我有用的解决方案是按照错误底部所说的去做:

      将新的环境变量“MKL_THREADING_LAYER”设置为值“GNU”。这个解决方案(更详细)来自https://github.com/Theano/Theano/issues/6568

      【讨论】:

        【解决方案3】:

        我也遇到了同样的问题:

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

        只有我需要降级的那些。后来发生了,我在使用 pip 安装其他数据包时意外升级到了 mlk=2018。但是后来theano为我工作仍然有效,不知道如何。

        【讨论】:

          猜你喜欢
          • 1970-01-01
          • 2016-02-03
          • 1970-01-01
          • 2016-04-19
          • 2018-06-20
          • 1970-01-01
          • 1970-01-01
          • 2018-09-18
          • 2017-10-21
          相关资源
          最近更新 更多