Keras AttributeError:“module”对象没有属性“relu”

2024-09-22 10:21:40 发布

您现在位置:Python中文网/ 问答频道 /正文

当我尝试在Python中使用keras时,PyCharm告诉我:

File "D:/Bitbucket/kaggle/Homesite Quote Conversion/keras_nn_test_0.96363.py", line 167, in <module>
    model.compile(loss='binary_crossentropy', optimizer="sgd")
AttributeError: 'module' object has no attribute 'relu'

有人知道为什么吗?在


Tags: inpytestbitbucketmodellinennpycharm
1条回答
网友
1楼 · 发布于 2024-09-22 10:21:40

这在他们的问题跟踪器上被标记为issue,这是由于{}上的版本不是最新的。 正如大多数用户建议的那样,通过克隆存储库并使用setup.py重新安装ano可以解决这个问题。在

注:在their installation guide中也明确提到了

Note: You should use the latest version of Theano, not the PyPI version. Install it with:

sudo pip install git+git://github.com/Theano/Theano.git

当然还有其他的依赖关系。在

相关问题 更多 >