【问题标题】:Tensorflow CuDNNLSTM keras error. TypeError: ('Keyword argument not understood:', 'time_major')TensorFlow CuDNNLSTM keras 错误。 TypeError:('关键字参数不理解:','time_major')
【发布时间】:2019-02-27 04:01:14
【问题描述】:

在 tensorflow 1.13.1 中保存 CuDNNLSTM 模型后,我尝试立即将其加载回来以使用它。

我收到以下错误

TypeError: ('关键字参数不理解:', 'time_major')。

我查看了 python 的 tensorflow 的源代码,似乎基类 _CuDNNRNN()_init__() 已完全从初始化中删除 time_major
那为什么time_major会被写入文件model.save()呢?

【问题讨论】:

  • 我什么都没做,今天再次运行代码,它工作正常。我不知道为什么。昨晚我什至没有关闭我的电脑。完全相同的状态
  • 我也有这个问题,我使用的是 plaidml,因为我没有用于 tensorflow 的 CUDA gpu。我只是在允许的参数中添加了 time_major 大声笑希望它不会引起任何问题。

标签: python tensorflow keras keras-layer cudnn


【解决方案1】:

更改导入

from keras.models import model_from_json

from tensorflow.keras.models import model_from_json

对我的情况有所帮助。

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2020-12-09
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2020-12-09
    • 2021-08-17
    • 2018-12-29
    相关资源
    最近更新 更多