我的自定义callblack:
class CustomCallback(keras.callbacks.Callback):
def on_train_begin(self, logs=None):
print("on_train_begin")
def on_train_batch_end(self, batch, logs=None):
print("on_train_batch_end")
def on_batch_end(self, batch, logs=None):
print("on_batch_end")
问题:在培训期间,我只看到"on_train_begin"出现在输出中。
我的Tensorflow版本:1.15我的Keras版本:2.2.5
有答案吗?
谢谢
p。s:我不想改变我的Keras/TF版本
我不得不打电话:
clist.on_train_batch_end(batch_num, logs)
训练循环中的
clist = CallbackList(callbacks=self.callbacks)