Week 2 exercise 3.2

its giving error for accuracy

NameError Traceback (most recent call last)
in
19 optimizer = 0.1*base_learning_rate
20 # Use accuracy as evaluation metric
—> 21 metrics=accuracy
22
23 ### END CODE HERE

NameError: name ‘accuracy’ is not defined

Please include the assignment number when you post on the Forums. Each week has between 1 and 3 assignments.
Or list the assignment name.

To your issue: Try putting single-quotes around ‘accuracy’.

1 Like

its Assignment 2 of week 2, CNN Course.
the main error lies in the Adam line, as it gives error in next line.
Sorry, Ithe copied the previous error by mistake/
optimizer = tf.keras.optimizers.Adam(learning_rate=0.1)

Your code (noted as line 21) still just has metrics=accuracy.
‘accuracy’ should be a text string, not a variable name.

2 Likes