keras错误:InvalidArgumentError:形状不兼容

时间:2018-11-01 13:48:04

标签: keras deep-learning

某些VAE模型失败。 如果我把下面的代码 InvalidArgumentError:不兼容的形状:[1800]与[1785] 我收到上述错误消息。值之间的差异始终与batch_size相同。

其他主要设置值:n:755,m:119,潜影:32,filter_size:16,batch_size:15,历元:100

input_img = keras.Input (shape = img_shape)

x = layers.Conv2D (filter_size, 3,
                  padding = 'same', activation = 'relu') (input_img)
x = layers.Conv2D (filter_size * 2, 3,
                  padding = 'same', activation = 'relu'
                  strides = (1, 2)) (x)
x = layers.Conv2D (filter_size * 2, 3,
                  padding = 'same', activation = 'relu') (x)
x = layers.Conv2D (filter_size * 2, 3,
                  padding = 'same', activation = 'relu') (x)
shape_before_flattening = K.int_shape (x)

x = layers.Flatten () (x)
x = layers.Dense (filter_size, activation = 'relu') (x)

z_mean = layers.Dense (latent_dim) (x)
z_log_var = layers.Dense (latent_dim) (x)

0 个答案:

没有答案