Не убираются сообщения о предупреждениях в jupyter notebook. Как убрать?
Я пробовал 3 варианта:
1
import warnings
def function_that_warns():
warnings.warn("deprecated", DeprecationWarning)
with warnings.catch_warnings():
warnings.simplefilter("ignore")
function_that_warns() # this will not show a warning
2
import warnings
warnings.filterwarnings('ignore')
warnings.simplefilter('ignore')
3
import warnings
warnings.filterwarnings("ignore")
Ни один способ не помог, сообщения все равно вылазят:
Мой код:
from keras.callbacks import EarlyStopping, ModelCheckpoint
early_stop = EarlyStopping(monitor='val_acc', min_delta=0.001,
patience=10, verbose=1, mode='auto')
chkpt = ModelCheckpoint('best_delivery_model',
monitor='val_loss',
verbose=1,
save_best_only=True,
mode='auto')
callbacks = [early_stop, chkpt]
hist = n_model.fit(x_train, y_train,
batch_size=batch_size,
epochs=30,
validation_data=(x_test, y_test),
callbacks=callbacks)
