apple / tensorflow_macos

TensorFlow for macOS 11.0+ accelerated using Apple's ML Compute framework.
Other
3.67k stars 308 forks source link

Callback on_train_batch_begin/end not called during fit() #238

Open zazula opened 3 years ago

zazula commented 3 years ago

on_train_batch_begin() and on_train_batch_end() are not being called on callbacks.

on_batch_begin() and on_batch_end() are being called and are the workaround.

That is, this does not work: tf.keras.callbacks.LambdaCallback(on_train_batch_end=lambda batch, logs: do_something())

but this does: tf.keras.callbacks.LambdaCallback(on_batch_end=lambda batch, logs: do_something())

tensorflow: 2.4.0-rc0