CNN course week 3 U-net problem

I think I have a dimensional problem here. The message I’m receibing is:

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

The problem seems to be when I try to define ublock7. I’m using the first component of ublock6, the second component of cblock3 and number of filters *4, as parameters.

I can’t figure out what is wrong here. Any help is appreciated.

1 Like

Hi @zbest
Please, could you provide the assignment and exercise number you are talking about?

The u-net assignment is C4 W3 A2.
The title of the thread states C4 and W3.

Hi @zbest
When you are upsampling, in the ublockx don’t reference the element number. Just use the unlock, without any reference. And your second argument is correct.
I think this can fix the issue.


Thanks Carlos, you’re right. I had the same problem, the thing is to check what kind of variables are each block storing. The ublocks only return one variable, unlike the cblocks.

I am glad to know you got the point. :grinning_face_with_smiling_eyes: