Skip to content

Commit

Permalink
Fix verbose warnings.
Browse files Browse the repository at this point in the history
  • Loading branch information
mzr1996 committed Sep 8, 2021
1 parent 7147865 commit 9ba3c96
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion mmcls/models/classifiers/image.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@
from ..utils.augment import Augments
from .base import BaseClassifier

warnings.simplefilter('once')


@CLASSIFIERS.register_module()
class ImageClassifier(BaseClassifier):
Expand Down Expand Up @@ -74,7 +76,6 @@ def extract_feat(self, img):
if self.return_tuple:
if not isinstance(x, tuple):
x = (x, )
warnings.simplefilter('once')
warnings.warn(
'We will force all backbones to return a tuple in the '
'future. Please check your backbone and wrap the output '
Expand Down

0 comments on commit 9ba3c96

Please sign in to comment.