TypeError: '<' not supported between instances of 'tuple' and 'float'

After writing the following code, I am getting this error. Please help!

{moderator edit - solution code removed}

All those lines have trailing comma, making the entire thing into one list. Is that what you intended?

I solved it! Thank you so much for the hint

1 Like


Remember there are two distinct model definition approaches available in TensorFlow . The one used in this exercise is the functional API. Each layer is a distinct Python expression. It looks like this:

x = layers.Conv2D(64, 3, activation="relu")(block_3_output)
x = layers.GlobalAveragePooling2D()(x)
x = layers.Dense(256, activation="relu")(x)
x = layers.Dropout(0.5)(x)
outputs = layers.Dense(10)(x)

The other one is the called the sequential model
in which the layers are provided as a comma delimited list. It looks like this:

# Define Sequential model with 3 layers
model = keras.Sequential(    [       
       layers.Dense(2, activation="relu", name="layer1"), 
       layers.Dense(3, activation="relu", name="layer2"),    
       layers.Dense(4, name="layer3"), 

You can use either one, but yours initially was kind of a hybrid combining the two. :wink: