theano安装问题

时间:2023-03-10 05:56:22
theano安装问题
WARNING (theano.configdefaults): g++ not available, if using conda: `conda install m2w64-toolchain`
D:\Anaconda3\lib\site-packages\theano\configdefaults.py:: UserWarning: DeprecationWarning: there is no c++ compiler.This is deprecated and with Theano 0.11 a c++ compiler will be mandatory
warnings.warn("DeprecationWarning: there is no c++ compiler."
WARNING (theano.configdefaults): g++ not detected ! Theano will be unable to execute optimized C-implementations (for both CPU and GPU) and will default to Python implementations. Performance will be severely degraded. To remove this warning, set Theano flags cxx to an empty string.
WARNING (theano.tensor.blas): Using NumPy C-API based implementation for BLAS functions.

按照正常的顺序安装完(http://www.deeplearning.net/software/theano/install.html),提示警告,如上。

于是,conda install m2w64-toolchain。

爆出一堆错误

于是,conda install libpython (https://blog.csdn.net/weixin_40849273/article/details/85266465)

更是一堆错误

Traceback (most recent call last):
File "D:\Anaconda3\lib\configparser.py", line , in _unify_values
sectiondict = self._sections[section]
KeyError: 'blas' During handling of the above exception, another exception occurred: Traceback (most recent call last):
File "D:\Anaconda3\lib\site-packages\theano\configparser.py", line , in fetch_val_for_key
return theano_cfg.get(section, option)
File "D:\Anaconda3\lib\configparser.py", line , in get
d = self._unify_values(section, vars)
File "D:\Anaconda3\lib\configparser.py", line , 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 "D:\Anaconda3\lib\site-packages\theano\configparser.py", line , in __get__
delete_key=delete_key)
File "D:\Anaconda3\lib\site-packages\theano\configparser.py", line , 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 "<stdin>", line , in <module>
File "D:\Anaconda3\lib\site-packages\theano\__init__.py", line , in <module>
from theano.scan_module import (scan, map, reduce, foldl, foldr, clone,
File "D:\Anaconda3\lib\site-packages\theano\scan_module\__init__.py", line , in <module>
from theano.scan_module import scan_opt
File "D:\Anaconda3\lib\site-packages\theano\scan_module\scan_opt.py", line , in <module>
from theano import tensor, scalar
File "D:\Anaconda3\lib\site-packages\theano\tensor\__init__.py", line , in <module>
from theano.tensor import blas
File "D:\Anaconda3\lib\site-packages\theano\tensor\blas.py", line , in <module>
from theano.tensor.blas_headers import blas_header_text
File "D:\Anaconda3\lib\site-packages\theano\tensor\blas_headers.py", line , in <module>
if not config.blas.ldflags:
File "D:\Anaconda3\lib\site-packages\theano\configparser.py", line , in __get__
val_str = self.default()
File "D:\Anaconda3\lib\site-packages\theano\configdefaults.py", line , in default_blas_ldflags
check_mkl_openmp()
File "D:\Anaconda3\lib\site-packages\theano\configdefaults.py", line , in check_mkl_openmp
""")
RuntimeError:
To use MKL with Theano either update the numpy conda packages to
their latest build or set "MKL_THREADING_LAYER=GNU" in your
environment.

于是,新建环境变量MKL_THREADING_LAYER=GNU,

似乎不管用

于是,conda update numpy

solved。

可以使用theano,但是当我尝试使用theano.scan时,

Process finished with exit code - (0xC0000005)

墙内墙外多番查找,最终发现此贴可用!(https://blog.csdn.net/wangguan9527/article/details/82845409)

solved。