Week 3 Assignment 2 unet_model

On the expanding path, I keep getting the following error for ublock 7:

ValueError: Input 0 of layer conv2d_transpose_8 is incompatible with the layer: : expected min_ndim=4, found ndim=3. Full shape received: [12, 16, 256]

For some reason, ublock 6 doesn’t have this problem, but ublock 7 does. I checked my code for both of them, and they both seem right. The only thing I can understand from this error message is that I somehow lost a dimension, but I’m not sure when or where it happened.

Here’s another thread about what sounds to me like the same problem. Please have a look and let us know if that solves your problem or not.

It does work. Thank you for your detailed explanation!