我正在尝试运行一个用于印地语到英语翻译的示例代码。ImportError:无法在Keras中导入名称TimeDistributedDense
当我运行当我搜索在谷歌,我发现这个解决方案提供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
使用sudo python setup.py install
安装keras但仍然当我运行提供的代码https://github.com/karimkhanp/Seq2Seq我得到相同的错误。
如果有人发现任何解决方案,请帮助。
什么Keras版本您使用的? TimeDistributedDense已在Keras 2.0.0中删除 –
@MatiasValdenegro:'python -c“import keras; print keras .__ version__” 使用TensorFlow后端。 2.0.6 '我使用的这个版本 – user123