ValueError:“CAE_Model”层的输入 0 与该层不兼容:预期形状=(None, 576, 704, 3),找到的形状=(32, 704, 3)

问题描述 投票:0回答:1

model.fit 时出错 第二个截图

尝试重塑,并给出参数输出形状,顺便说一句,它不存在

帮助,第二天试图解决这个问题`

tensorflow keras convolution encoder decoder
1个回答
0
投票

顺便说一句,答案很简单。由于自动编码试图在 ndarray 中从 3 维移动到 4 维,并且在移动时遇到问题。所以我们需要在之前添加 1 个维度。

例如:

test_data = [x, y, z]
temp = test_data[np.newaxis, ...] # so we get test_data = [1, x, y, z]
© www.soinside.com 2019 - 2024. All rights reserved.