gpt4 book ai didi

python - ValueError : Error when checking target: expected time_distributed_7 to have 4 dimensions, 但得到形状为 (500, 18, 64) 的数组

转载 作者:行者123 更新时间:2023-11-30 09:46:22 24 4
gpt4 key购买 nike

我在我的模型中找不到问题。这是我的模型摘要:

________________________________________________________________
Layer (type) Output Shape Param #
=================================================================
input_11 (InputLayer) (None, 32, 100, 3) 0
_________________________________________________________________
conv2d_75 (Conv2D) (None, 29, 97, 64) 3136
_________________________________________________________________
max_pooling2d_23 (MaxPooling (None, 14, 48, 64) 0
_________________________________________________________________
conv2d_76 (Conv2D) (None, 10, 44, 256) 409856
_________________________________________________________________
max_pooling2d_24 (MaxPooling (None, 5, 22, 256) 0
_________________________________________________________________
conv2d_77 (Conv2D) (None, 5, 22, 512) 1180160
_________________________________________________________________
conv2d_78 (Conv2D) (None, 5, 22, 1024) 4719616
_________________________________________________________________
conv2d_79 (Conv2D) (None, 5, 22, 1024) 9438208
_________________________________________________________________
conv2d_80 (Conv2D) (None, 5, 22, 3072) 3148800
_________________________________________________________________
dropout_15 (Dropout) (None, 5, 22, 3072) 0
_________________________________________________________________
dense_8 (Dense) (None, 5, 22, 4096) 12587008
_________________________________________________________________
dropout_16 (Dropout) (None, 5, 22, 4096) 0
_________________________________________________________________
conv2d_81 (Conv2D) (None, 5, 22, 64) 262208
_________________________________________________________________
time_distributed_7 (TimeDist (None, 5, 22, 64) 4160
=================================================================
Total params: 31,753,152
Trainable params: 31,753,152
Non-trainable params: 0

该模型似乎在任何时候都没有给出 3 维输出。请帮我找出问题所在。

最佳答案

  • 模型的输出形状:(任意、5、22、64)
  • Y_train 的输出形状:(500, 18, 64)

这两个形状必须匹配。

关于python - ValueError : Error when checking target: expected time_distributed_7 to have 4 dimensions, 但得到形状为 (500, 18, 64) 的数组,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/52140607/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com