Getting the message 'Cleanup called...' repeatedly while training a model on kaggle. How can we get rid of this? (CNN model using Keras)

Viewed 892
model.compile(optimizer='adam',loss='categorical_crossentropy', metrics=['accuracy'])

history = model.fit(train_data,epochs = 1,validation_data = test_data,verbose=1, callbacks =[earlystopping, csv_logger])

9/87606 [..............................] - ETA: 20:44 - loss: 0.2311 - accuracy: 0.8889 

Cleanup called...
Cleanup called...
Cleanup called...
Cleanup called...
Cleanup called...
Cleanup called...
Cleanup called...
Cleanup called...
Cleanup called...
Cleanup called...
Cleanup called...
Cleanup called...
Cleanup called...
Cleanup called...
Cleanup called...
Cleanup called...
Cleanup called...
Cleanup called...
Cleanup called...
Cleanup called...
Cleanup called...
Cleanup called...
2 Answers

I found this on Kaggle and it has worked for me. Just paste the code below and it should hopefully work for you too.

from IPython.display import clear_output

!pip install -q tensorflow==2.4.1

clear_output()

This is Actually a debugging message which is being displayed in Tensorflow. Try below code to disable it.

import tensorflow as tf

tf.get_logger().setLevel('INFO')*
Related