Spaces:
Runtime error
Runtime error
NORLIE JHON MALAGDAO
commited on
Update app.py
Browse files
app.py
CHANGED
@@ -107,7 +107,7 @@ data_augmentation = keras.Sequential(
|
|
107 |
model = Sequential([
|
108 |
data_augmentation,
|
109 |
normalization_layer,
|
110 |
-
layers.Conv2D(32, 3, padding='same', activation='relu'),
|
111 |
layers.MaxPooling2D(),
|
112 |
layers.Conv2D(64, 3, padding='same', activation='relu'),
|
113 |
layers.MaxPooling2D(),
|
@@ -126,6 +126,9 @@ model = Sequential([
|
|
126 |
layers.Dense(num_classes, activation='softmax')
|
127 |
])
|
128 |
|
|
|
|
|
|
|
129 |
model.compile(optimizer=keras.optimizers.Adam(learning_rate=0.001),
|
130 |
loss=tf.keras.losses.SparseCategoricalCrossentropy(from_logits=False),
|
131 |
metrics=['accuracy'])
|
|
|
107 |
model = Sequential([
|
108 |
data_augmentation,
|
109 |
normalization_layer,
|
110 |
+
layers.Conv2D(32, 3, padding='same', activation='relu', input_shape=(img_height, img_width, 3)),
|
111 |
layers.MaxPooling2D(),
|
112 |
layers.Conv2D(64, 3, padding='same', activation='relu'),
|
113 |
layers.MaxPooling2D(),
|
|
|
126 |
layers.Dense(num_classes, activation='softmax')
|
127 |
])
|
128 |
|
129 |
+
# Ensure the input shape is correctly passed
|
130 |
+
model.build((None, img_height, img_width, 3))
|
131 |
+
|
132 |
model.compile(optimizer=keras.optimizers.Adam(learning_rate=0.001),
|
133 |
loss=tf.keras.losses.SparseCategoricalCrossentropy(from_logits=False),
|
134 |
metrics=['accuracy'])
|