C4 W2 A2 Exercise 3: 'Accuracy' object is not subscriptable

In my code, the metrics is assigned to tf.keras.metrics.Accuracy(), then got error message as following:

Any idea how to solve?

There are several different ways you can specify the accuracy. You can see by reading the assertion that they are expecting you to use the “string name” approach, not to specify an instantiation of some metric function. And even if you want to specify a function, it has to be in the form of an element of a list just from a syntax point of view, but that will still fail the assertion. Please see the documentation for the Keras Model optimize method for more information.

@paulinpaloalto Thank you so much! Sometimes, the solution is just so obvious…:slight_smile: