Maybe you can help me out with some issues I am experiencing in the Keras tutorial from W1. When I try to generate the function happyModel, I experience the following error when calling dense function (I have already gone through the TensorFlow help, and it doesn’t work),
Do the commas need to be added after the command tfl.Dense(…)? I am also suspecting that I didn’t introduce well the input shape in the ZeroPadding2D method. How shall I introduce the input size?
The way I am doing it and it doesn’t work is the following one
The layers are identified within a set of square brackets, separated by commas.
The last layer has no comma, because there is nothing to separate it from.
The instructions for zero padding specifically tell you to use “input shape of 64 x 64 x 3”. Those are hard-coded constants.
You can’t use those variable names, because they’re globals and won’t have the correct values in all situations.
Thanks @TMosh, but I did not find this as an argument for ZeroPadding2D function from the TensorFlow Doc., there’s just the ‘padding’ and ‘dataformat’ args. How did you come to know about that argument??
Just curious cause I wasted so much time on this.
Also what’s that x in tf.keras.layers.ZeroPadding2D(padding=1)(x) in the example given in the doc., what does it signify???
Hi @TMosh, could you clarify more on how to know that this “input_shape” argument should be provided?
I was just randomly clicking through a few layers in the tensorflow documentation and saw this which looks like the correct thing to do, But if I only searched for tf.keras.layers.ZeroPadding2D documentation, I would have never thought about using “input_shape”.
I would have expected the matrix to include 1s and 0s (since there is generally a threshold applied to sigmoid output so you can compare it to the true output), but it seems to include values between 0.9 and 1? I am unsure what the threshold the model is using and where to find this. I have looked at the TF documentation for the dense layer and also losses but they don’t seem to specify.