Week 2 assignment 2 error, Test failed

{mentor edit: code removed}

Test failed
Expected value

[‘Sequential’, (None, 160, 160, 3), 0]

does not match the input value:

[‘Functional’, (None, 5, 5, 1280), 2257984]

AssertionError Traceback (most recent call last)
in
10 [‘Dense’, (None, 1), 1281, ‘linear’]] #linear is the default activation
11
—> 12 comparator(summary(model2), alpaca_summary)
13
14 for layer in summary(model2):

~/work/W2A2/test_utils.py in comparator(learner, instructor)
19 “\n\n does not match the input value: \n\n”,
20 colored(f"{a}", “red”))
—> 21 raise AssertionError(“Error in test”)
22 print(colored(“All tests passed!”, “green”))
23

AssertionError: Error in test

You used data_augmenter() instead of data_augmentation(). And you need to pass it a data argument.
And in most of the other layers, you used the wrong data arguments.

1 Like

Test failed
Expected value

[‘Sequential’, (None, 160, 160, 3), 0]

does not match the input value:

[‘TensorFlowOpLayer’, [(None, 160, 160, 3)], 0]

Now this is the error, could you please help me point out the error, i am new to keras and dont understand it well, thanks

You might be using the wrong data argument for data_augmentation().
Or you have an error in your data_augmenter() function.

UNQ_C1

GRADED FUNCTION: data_augmenter

def data_augmenter():
‘’’
Create a Sequential model composed of 2 layers
Returns:
tf.keras.Sequential
‘’’
{mentor edit: code removed}

return data_augmentation

this is my data augmentor function

1 Like

When I run your code, I get an assert error.
image

It’s a syntax error. Try a single-quote there instead of double-quote.

Also, you should not have a comma after the last item in the list (the “random rotation” layer).

I have no error in the data_augmentor function, but it still show me that same error

Test failed
Expected value

[‘Sequential’, (None, 160, 160, 3), 0]

does not match the input value:

[‘Functional’, (None, 5, 5, 1280), 2257984]

AssertionError Traceback (most recent call last)
in
10 [‘Dense’, (None, 1), 1281, ‘linear’]] #linear is the default activation
11
—> 12 comparator(summary(model2), alpaca_summary)
13
14 for layer in summary(model2):

~/work/W2A2/test_utils.py in comparator(learner, instructor)
19 “\n\n does not match the input value: \n\n”,
20 colored(f"{a}", “red”))
—> 21 raise AssertionError(“Error in test”)
22 print(colored(“All tests passed!”, “green”))
23

AssertionError: Error in test

That’s a different error, because now the tensor size is wrong.

I tried some things and after reading the literature, figured it out, thanks for your help