Week 1 Assignment 2 - Functional API - Convolutional Model

You’re going to scream :scream_cat: when you hear this. I think the problem is that you added an extra trailing comma at the end of the line on the previous Conv2D layer. (I can see it in the exception trace that you gave.) That syntax in python turns the RHS of that assignment statement into a tuple. When I artificially introduce that bug in my code, I don’t get exactly the same error that you get, but it does fail spectacularly. My guess is that is at least part of the problem. Maybe you’ve got some other syntactic irregularities like that which also contribute.

Well, looking more closely at my error output, I do get the error about the shape from the ReLU being [1, None, 8, 8, 16], but I get it on the max pooling layer. It looks like maybe you somehow truncated everything at that point.

So I think that actually is the problem. Programming is a game of details. The difference between ; and : can spoil your whole afternoon. Or a stray , where you didn’t mean to put one …

4 Likes