【问题标题】:error in using concatenate in keras in google colab在谷歌 colab 的 keras 中使用连接时出错
【发布时间】:2020-08-21 15:33:32
【问题描述】:

图片中提到了错误。

TypeError                                 Traceback (most recent call last)
<ipython-input-200-8ea67f851d87> in <module>()
      1 final_model = Sequential([
----> 2   Concatenate([image_model, caption_model], mode='concat', concat_axis=1),
      3   Bidirectional(LSTM(256, return_sequences=False)),
      4   Dense(vocab_size),
      5   Activation('softmax')

【问题讨论】:

  • 错误提示 - 模式不是Concatenate 中的参数...
  • 您好 ComputerVisionEnthusiast,我们可以在代码前介绍问题时更好地帮助您,并将错误作为文本而不是屏幕截图分享,please see the guide on how to ask questions

标签: keras concatenation google-colaboratory keras-layer


【解决方案1】:

您错误地使用了连接层。将您的代码更改为以下内容:

final_model = Sequential([
             Concatenate([image_model, caption_model], axis=1),
             Bidirectional(LSTM(256, return_sequences=False))
             Dense(vocab_size), 5 Activation('softmax'),
             Activation('softmax')
])

【讨论】:

    猜你喜欢
    • 2020-08-18
    • 2021-10-05
    • 1970-01-01
    • 2021-10-06
    • 1970-01-01
    • 2021-01-26
    • 2021-04-20
    • 1970-01-01
    • 2019-11-27
    相关资源
    最近更新 更多