Cannot supress Python Warnings with warnings.filterwarnings("ignore")

6k views Asked by At

I am using the following to suppress my warnings. Sometimes the warning are suppressed, while more recently they are of no use and the warnings still appear.

> import warnings  
> warnings.filterwarnings("ignore")

I am using Jupyter-notebook and working with Tensorflow (also with Keras, but not for this particular question, but the same thing happens with Keras as well)

1

There are 1 answers

0
sophros On BEST ANSWER

If it stopped working maybe you forgot to execute first the cell with the ignoring code?

import warnings
warnings.filterwarnings('ignore')
warnings.simplefilter('ignore')

Please note the additional line as per the answer to Disable warnings in jupyter notebook.