Skip to content

Commit 5a1bb4a

Browse files
authored
Merge pull request #2 from nestoralonso/patch-1
specify the input shape in the first layer
2 parents 75ce961 + 816e1d8 commit 5a1bb4a

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

LearnDigitz/keras_train.py

+2-2
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, )),
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)