AttributeError: 'myCallback' object has no attribute 'set_model' in TF1 Course 1 Week 3

As per previous callback methods in assignments, I have created a similar a method mentioning accuracy >= 0.995. However, while calling: history = model.fit(training_images, training_labels, epochs=10, callbacks=[callbacks]), i am getting this error:

AttributeError: 'myCallback' object has no attribute 'set_model'

Please help.

Has your callback inherited from tensorflow.keras.callbacks.Callback ?

2 Likes

Oh. I forgot to inherit from the correct class. Thank you for quick reply. it got fixed

2 Likes

In previous assignment, i had experienced the same problem.

Is your issue now solved sir?

1 Like

yes, i solved it. Thanks for asking.

Pleasure is all mine sir

how do we know that we have inherited from tensorflow.keras.callbacks.Callback?

@Rifah_Maulidya

isinstance(my_callback_instance, tf.keras.callbacks.Callback) will return True

1 Like