From 3ef52b2ec698c3124cf405150c65e0a4c03500f0 Mon Sep 17 00:00:00 2001 From: Kaipeng Deng Date: Wed, 7 Apr 2021 15:01:06 +0800 Subject: [PATCH] fix warning (#2501) * fix warning --- ppdet/modeling/__init__.py | 6 ++++++ requirements.txt | 1 + tools/eval.py | 4 ---- tools/export_model.py | 4 ---- tools/infer.py | 3 --- tools/train.py | 3 --- 6 files changed, 7 insertions(+), 14 deletions(-) diff --git a/ppdet/modeling/__init__.py b/ppdet/modeling/__init__.py index 8e8d41fa4..01968ba3c 100644 --- a/ppdet/modeling/__init__.py +++ b/ppdet/modeling/__init__.py @@ -1,3 +1,9 @@ +# OP docs may contains math formula which may cause +# DeprecationWarning in string parsing +import warnings +warnings.filterwarnings( + action='ignore', category=DeprecationWarning, module='ops') + from . import ops from . import backbones from . import necks diff --git a/requirements.txt b/requirements.txt index 4a74e50ca..8ce34b5f0 100644 --- a/requirements.txt +++ b/requirements.txt @@ -7,3 +7,4 @@ shapely scipy terminaltables pycocotools +setuptools>=42.0.0 diff --git a/tools/eval.py b/tools/eval.py index 3025dd822..56e350d92 100755 --- a/tools/eval.py +++ b/tools/eval.py @@ -22,10 +22,6 @@ parent_path = os.path.abspath(os.path.join(__file__, *(['..'] * 2))) if parent_path not in sys.path: sys.path.append(parent_path) -# ignore warning log -import warnings -warnings.filterwarnings('ignore') - import paddle from ppdet.core.workspace import load_config, merge_config diff --git a/tools/export_model.py b/tools/export_model.py index 8cf3885c8..6665d2bf9 100644 --- a/tools/export_model.py +++ b/tools/export_model.py @@ -21,10 +21,6 @@ parent_path = os.path.abspath(os.path.join(__file__, *(['..'] * 2))) if parent_path not in sys.path: sys.path.append(parent_path) -# ignore warning log -import warnings -warnings.filterwarnings('ignore') - import paddle from ppdet.core.workspace import load_config, merge_config diff --git a/tools/infer.py b/tools/infer.py index 19d7b36f6..c33d7a438 100755 --- a/tools/infer.py +++ b/tools/infer.py @@ -21,9 +21,6 @@ parent_path = os.path.abspath(os.path.join(__file__, *(['..'] * 2))) if parent_path not in sys.path: sys.path.append(parent_path) -# ignore warning log -import warnings -warnings.filterwarnings('ignore') import glob import paddle diff --git a/tools/train.py b/tools/train.py index 565ba8e90..0ae86da07 100755 --- a/tools/train.py +++ b/tools/train.py @@ -22,9 +22,6 @@ parent_path = os.path.abspath(os.path.join(__file__, *(['..'] * 2))) if parent_path not in sys.path: sys.path.append(parent_path) -# ignore warning log -import warnings -warnings.filterwarnings('ignore') import random import numpy as np -- GitLab