"Failed test case: 'on_epoch_end' method's signature missing 'epoch' parameter

On my assignment, for Week 2, I get the following error

“Failed test case: ‘on_epoch_end’ method’s signature missing ‘epoch’ parameter.
Expected:
True,
but got:
False.”

This is how I defined my callback:

class myCallback(keras.callbacks.Callback):
# Define the correct function signature for on_epoch_end
def on_epoch_end(self, epoc, logs={}):
if logs.get(‘accuracy’) is not None and logs.get(‘accuracy’) > 0.99:
print(“\nReached 99% accuracy so cancelling training!”)

            # Stop training once the above condition is met
            self.model.stop_training = True

Could anyone please comment on what is missing? Thanks a lot!

Please move this topic to the right subcategory. Here’s the community user guide to get started.