NVIDIA/DALI

Can't suppress warnings

Open

#4 396 ouverte le 27 oct. 2022

Voir sur GitHub
 (1 commentaire) (0 réactions) (1 assigné)C++ (670 forks)auto 404
help wanted

Métriques du dépôt

Stars
 (5 722 stars)
Métriques de merge PR
 (Métriques PR en attente)

Description

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.

Guide contributeur