我正在使用keras安装anaconda环境,并使用theano后端 . 但我不能让theano工作 . 这是我所做的,也是之后发现的错误 .
Step 1 :下载最新版本的anaconda,然后通过' bash Anaconda3-5.0.1-Linux-x86_64.sh'安装在linux中
Step 2 :conda install -c conda-forge keras,安装keras 2.0.9
这也安装了theano 1.0.1,如下所示:
The following NEW packages will be INSTALLED:
keras: 2.0.9-py36_0 conda-forge
libgpuarray: 0.7.5-0 conda-forge
mako: 1.0.7-py36_0 conda-forge
pygpu: 0.7.5-py36_0 conda-forge
theano: 1.0.1-py36_1 conda-forge
The following packages will be SUPERSEDED by a higher-priority channel:
conda: 4.3.30-py36h5d9f9f4_0 --> 4.3.29-py36_0 conda-forge
conda-env: 2.6.0-h36134e3_1 --> 2.6.0-0 conda-forge
接下来,测试theano:
python
Python 3.6.3 |Anaconda, Inc.| (default, Oct 13 2017, 12:02:49)
[GCC 7.2.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import theano
>>> theano.ifelse
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
AttributeError: module 'theano' has no attribute 'ifelse'
最后一行显示的错误阻止我正确使用theano和keras . 我在不同平台上运行的所有代码都不起作用,因为它们会产生类似的错误 .
我还尝试按照http://deeplearning.net/software/theano/install_ubuntu.html的说明使用新的anaconda安装 to just install theano ,没有keras . 但是在安装之后,通过上面的测试线,我得到了同样的错误 .
有关如何解决此问题的任何建议吗?
非常感谢!