C4W2A2-Transfer Learning with MobileNetV2

I got error in the metrics part as below
"TypeError Traceback (most recent call last)
in
3 assert type(optimizer) == tf.keras.optimizers.Adam, “This is not an Adam optimizer”
4 assert optimizer.lr == base_learning_rate / 10, “Wrong learning rate”
----> 5 assert metrics[0] == ‘accuracy’, “Wrong metric”
6
7 print(‘\033[92mAll tests passed!’)

TypeError: ‘Accuracy’ object is not subscriptable

My code is follows

grade cells codes removed as it is against community guidelines

model2.compile(loss=loss_function,
optimizer = optimizer,
metrics=metrics)

this is incorrect. Use [‘accuracy’]

Also kindly avoid posting any grade cell codes from your future post, it is against community guidelines.

Thanks for the information. I make the error correct

1 Like