Dimension mismatch in Keras during model.fit

后端 未结 2 722
自闭症患者
自闭症患者 2020-12-20 07:11

I put together a VAE using Dense Neural Networks in Keras. During model.fit I get a dimension mismatch, but not sure what is throwing the code off. Below is wha

2条回答
  •  粉色の甜心
    2020-12-20 07:32

    Just tried to replicate and found out that when you define

    x = Input(batch_shape=(batch_size, original_dim))

    you're setting the batch size and it's causing a mismatch when it starts to validate. Change to

    x = Input(shape=input_shape)
    

    and you should be all set.

提交回复
热议问题