Reputation: 59
I'm trying to use 2 methods, such as Conv2D and LSTM. I have already run ImageDataGenerator code.enter image description here
it shows that: Found 1312 images belonging to 3 classes. Found 876 images belonging to 3 classes.
My shape training and val is (150,150,1) and (150,150,1). Here the code for combining Conv2d + LSTM enter image description here
Aftar I have run program model_image, it shows that: "Input 0 of layer conv2d_76 is incompatible with the layer: : expected min_ndim=4, found ndim=3. Full shape received: (3000, 150, 1)"
I have already used many ways to handle that error (such as Flatten and Reshape layers). But, the result is same. I don't know how to solve this code. Help me please, it's such to be honour for help me. Thank you
Upvotes: 0
Views: 241
Reputation: 1916
Try using the expand_dims() function from TF.
https://www.tensorflow.org/api_docs/python/tf/expand_dims
Upvotes: 1