Skip to content

fix - using input.shape instead of input_shape for layers which is not available anymore #485

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 2 additions & 8 deletions learntools/deep_learning_intro/ex2.py
Original file line number Diff line number Diff line change
Expand Up @@ -61,10 +61,7 @@ def check(self, model):
assert (layer_classes == true_classes), \
("Your model doesn't have the correct kinds of layers. You should have five layers with classes: Dense, Dense, Dense, Dense.")
# Check input shape
try:
input_shape = dense_layer.input_shape
except:
input_shape = None
input_shape = dense_layer.input.shape
assert (input_shape == (None, inputs)), \
("Your model should have {} inputs. Make sure you answered the previous question correctly!".format(inputs))
# Check activation functions
Expand Down Expand Up @@ -111,10 +108,7 @@ def check(self, model):
assert (layer_classes == true_classes), \
("Your model doesn't have the correct kinds of layers. You should have five layers with classes: Dense, Activation, Dense, Activation, Dense.")

try:
input_shape = model.layers[0].input_shape
except:
input_shape = None
input_shape = model.layers[0].input.shape
assert (input_shape == (None, 8)), \
("Your model should have 8 inputs. Did you include the input shape to the first layer?")
dense_activations = [layer.activation.__name__ for layer in model.layers]
Expand Down