This is my code:
model = keras.models.Sequential([
keras.layers.Flatten(60000,28,28),
keras.layers.Dense(128, activation ="relu"),
keras.layers.Dense(10),
])
This is the output:
TypeError Traceback (most recent call last)
<ipython-input-14-dc603c39e27e> in <cell line: 1>()
1 model = keras.models.Sequential([
----> 2 keras.layers.Flatten(60000,28,28),
3 keras.layers.Dense(128, activation ="relu"),
4 keras.layers.Dense(10),
5 ])
TypeError: Flatten.__init__() takes from 1 to 2 positional arguments but 4 were given
What can I do to solve this?
I think at the first layer, you're supposed to use
tf.keras.layers.InputLayerfor your input instead oftf.keras.layers.Flatten.Flattenis used to "flatten out" a multidimensional input into an onedimensional one (usually used to transition from a convolutional layer to a fully connected dense layer).Your code should be: