[Week 2] Mobilenet_v1 - alpaca_model -Test Failed Expected Value


In Exercise 2: alpaca_model, I encountered an issue on the programming assignment with missing value: [‘Sequential’, (None, 160, 160, 3), 0]

Test failed
Expected value

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

I was wondering if anyone has a pointer on what’s missing or which area should I look at?

I was able to run the code and complete subsequent steps without any issue.

Warm Regards
Seng San


Below please find the model2.summary and the layer with sequential layer is missing:

The missing layer is identified by comparing with tutotial on tensorflow and below is a screenshot:

Appreciate any pointer on this issue.

Warm regards

Hi gsslim,

This could be caused by the data_augmentation function, resulting from changes to data_augmenter() in which the sequential layer is defined. If you rerun the cells from the beginning and everything works correctly the sequential layer may appear.

Hope this helps.


Thanks for the pointer. It is resolved


my data_augmenter() function is working just fine and tested correctly. I have tried 2 ways to define sequential models but still not getting the sequential part in ‘model2’.
Any suggestions?

BTW, I can still run and pass all tests after this ‘AssertionError’ in the remaining exercise.

1 Like

@reinoudbosch Can you help me and @bigballerbing to bail out of this problem. I am also facing the same issue as described here by @gsslim and thus far nothing works.
I have been stuck on this for more than 4 hours or so

I am getting this error :

Even though my data_augmenter() is correctly written, this missing Sequential Layer is posing problems as my Exercise 3 is also throwing error as in the very first line there we have :
base_model = model2.layers[4]

Now since for me the 4th layer is AveragePooling2d ,I get error as AveragePooling2D cannot be trainable.

Hi ashish_learns,

If you are certain your data_augmenter() is correct, do not forget to run the next cell (cell 7). In this cell data_augmentation is created. If you changed anything in your data_augmenter() but did not re-run this cell, the change made in data_augmenter() will not be included in your model through data_augmentation.

Hope this helps.

1 Like

I had run all my cells still I get the above errors.
What other things can I do?

Hi ashish_learns,

The only possibility I see is that you send me your code with a direct message. Then I can have a look what’s going on.

do not put activation in tfl.dense(1)
it is linear by default

1 Like


I have the same problem:
AssertionError: Error in test

Can you help me please?