【发布时间】:2018-01-19 17:41:46
【问题描述】:
我正在尝试运行一个将印地语翻译成英语的示例代码。
当我运行https://github.com/karimkhanp/Seq2Seq提供的代码时
Using TensorFlow backend.
Traceback (most recent call last):
File "seq2seq.py", line 5, in <module>
from model import seq2seq
File "/home/ubuntu/Documents/karim/Data/bse/phase3/deep_learning/Seq2Seq/seq2seq/model.py", line 5, in <module>
from keras.layers.core import Activation, RepeatVector, TimeDistributedDense, Dropout, Dense
ImportError: cannot import name TimeDistributedDense
当我在谷歌上搜索时,我发现了这个解决方案 - https://github.com/fchollet/keras/tree/b587aeee1c1be3633a56b945af3e7c2c303369ca
我尝试使用https://github.com/fchollet/keras/tree/b587aeee1c1be3633a56b945af3e7c2c303369ca 上提供的代码 Zip 包
使用sudo python setup.py install 安装了keras 但是当我运行https://github.com/karimkhanp/Seq2Seq 提供的代码时,我仍然遇到同样的错误。
如果有人找到任何解决方案,请提供帮助。
【问题讨论】:
-
您使用的是什么 Keras 版本?在 Keras 2.0.0 中删除了 TimeDistributedDense
-
@MatiasValdenegro:
python -c "import keras; print keras.__version__" Using TensorFlow backend. 2.0.6这个版本我正在使用
标签: python deep-learning keras