NVIDIA/DALI

Can't suppress warnings

Open

#4.396 geöffnet am 27. Okt. 2022

Auf GitHub ansehen
 (1 Kommentar) (0 Reaktionen) (1 zugewiesene Person)C++ (670 Forks)auto 404
help wanted

Repository-Metriken

Stars
 (5.722 Stars)
PR-Merge-Metriken
 (PR-Metriken ausstehend)

Beschreibung

I would like to suppress some warnings. Normally I could use the following code to do suppress all warnings.

import warnings
warnings.filterwarnings('ignore')

But when I import nvidia.dali there is still a warning shown. It looks like this comes from backend.py:

def deprecation_warning(what):
    # show only this warning
    with warnings.catch_warnings():
        warnings.simplefilter("default")
        warnings.warn(what, Warning, stacklevel=2)

The simplefilter just overwrites all previously changed warning setting. You could set the filter to lowest priority to not override everything already set with: warnings.simplefilter("default", append=True)

Or is there something I am missing? Thanks already.

Contributor Guide