Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Conv2D input shape is 4D(batch_size, rows, cols, depth)while this work input shape is 5D (batch_size, target_seq_len, rows, cols, depth) #4

Open
katieliao opened this issue Apr 26, 2022 · 3 comments

Comments

@katieliao
Copy link

Hello, I was trying to run this code. However, when I was trying to train the model, an error occur:

Input 0 of layer conv2d is incompatible with the layer: expected ndim=4, found ndim=5. Full shape received: [8, 5, 40, 40, 1]

8 is batch size, 5 is target sequence length, 40x40 is rows x cols and 1 is depth.

I just checked the source code and found that in "encoding" and "decoding" step, we have to run conv2d function, which requires a 4D input [batch size, rows, cols, channels]

How to tackle this problem?

@iamrakesh28
Copy link
Owner

Hi, Can you tell me which file you were trying run? I have defined some main functions inside datasets/.

@Aditya-1202
Copy link

Can you share the mnist_reshaped dataset?

@iamrakesh28
Copy link
Owner

iamrakesh28 commented Nov 23, 2024

Download the mnist dataset and use the generator to generate data of your dimension. You can refer the generator here: https://github.com/iamrakesh28/Deep-Learning-for-Weather-and-Climate-Science/tree/master/Moving-MNIST

On the top of file, you can specify the reshaped rows and cols dimension.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants