简体   繁体   中英

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

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)

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 .

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM