Skip to content

Commit e26431d

Browse files
authored
specify the input shape in the first layer
1 parent 75ce961 commit e26431d

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

LearnDigitz/keras_train.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ def mlp():
5050

5151
def cnn():
5252
return Sequential([
53-
Reshape((28, 28, 1)),
53+
Reshape((28, 28, 1), input_shape=(784, 1)),
5454
Conv2D(32, [5, 5], padding='same', activation='relu'),
5555
MaxPooling2D(strides=2),
5656
Conv2D(64, [5, 5], padding='same', activation='relu'),
@@ -93,4 +93,4 @@ def run(data_dir, model_dir, epochs):
9393
unique = datetime.now().strftime('%m.%d_%H.%M')
9494
model_dir = check_dir(os.path.join(output_dir, 'models', 'model_{}'.format(unique)))
9595
epochs = 10
96-
run(data_dir, model_dir, epochs)
96+
run(data_dir, model_dir, epochs)

0 commit comments

Comments
 (0)