未验证 提交 dd077f96 编写于 作者: G Guanghua Yu 提交者: GitHub

update solov2 some detail & fix paddle.enable_static() check_version (#1707)

* update solov2 some detail

* fix check paddle version
上级 5edb9c6c
...@@ -9,10 +9,14 @@ SOLOv2 (Segmenting Objects by Locations) is a fast instance segmentation framewo ...@@ -9,10 +9,14 @@ SOLOv2 (Segmenting Objects by Locations) is a fast instance segmentation framewo
- Performance: `Light-R50-VD-DCN-FPN` model reached 38.6 FPS on single Tesla V100, and mask ap on the COCO-val dataset reached 38.8, which increased inference speed by 24%, mAP increased by 2.4 percentage points. - Performance: `Light-R50-VD-DCN-FPN` model reached 38.6 FPS on single Tesla V100, and mask ap on the COCO-val dataset reached 38.8, which increased inference speed by 24%, mAP increased by 2.4 percentage points.
- Training Time: The training time of the model of `solov2_r50_fpn_1x` on Tesla v100 with 8 GPU is only 10 hours. - Training Time: The training time of the model of `solov2_r50_fpn_1x` on Tesla v100 with 8 GPU is only 10 hours.
<div align="center">
<img src="../../docs/images/instance_segmentation.png" width=800 />
</div>
## Model Zoo ## Model Zoo
| Backbone | Multi-scale training | Lr schd | V100 FP32(FPS) | Mask AP | Download | Configs | | Backbone | Multi-scale training | Lr schd | V100 FP32(FPS) | Mask AP<sup>val</sup> | Download | Configs |
| :---------------------: | :-------------------: | :-----: | :------------: | :-----: | :---------: | :------------------------: | | :---------------------: | :-------------------: | :-----: | :------------: | :-----: | :---------: | :------------------------: |
| Mobilenetv3-FPN | True | 3x | 50 | 30.0 | [model](https://paddlemodels.bj.bcebos.com/object_detection/solov2_mobilenetv3_fpn_448_3x.pdparams) | [config](https://github.com/PaddlePaddle/PaddleDetection/tree/master/configs/solov2/solov2_mobilenetv3_fpn_448_3x.yml) | | Mobilenetv3-FPN | True | 3x | 50 | 30.0 | [model](https://paddlemodels.bj.bcebos.com/object_detection/solov2_mobilenetv3_fpn_448_3x.pdparams) | [config](https://github.com/PaddlePaddle/PaddleDetection/tree/master/configs/solov2/solov2_mobilenetv3_fpn_448_3x.yml) |
| R50-FPN | False | 1x | 21.9 | 35.6 | [model](https://paddlemodels.bj.bcebos.com/object_detection/solov2_r50_fpn_1x.pdparams) | [config](https://github.com/PaddlePaddle/PaddleDetection/tree/master/configs/solov2/solov2_r50_fpn_1x.yml) | | R50-FPN | False | 1x | 21.9 | 35.6 | [model](https://paddlemodels.bj.bcebos.com/object_detection/solov2_r50_fpn_1x.pdparams) | [config](https://github.com/PaddlePaddle/PaddleDetection/tree/master/configs/solov2/solov2_r50_fpn_1x.yml) |
...@@ -20,10 +24,14 @@ SOLOv2 (Segmenting Objects by Locations) is a fast instance segmentation framewo ...@@ -20,10 +24,14 @@ SOLOv2 (Segmenting Objects by Locations) is a fast instance segmentation framewo
| R101-VD-FPN | True | 3x | 12.1 | 42.6 | [model](https://paddlemodels.bj.bcebos.com/object_detection/solov2_r101_vd_fpn_3x.pdparams) | [config](https://github.com/PaddlePaddle/PaddleDetection/tree/master/configs/solov2/solov2_r101_vd_fpn_3x.yml) | | R101-VD-FPN | True | 3x | 12.1 | 42.6 | [model](https://paddlemodels.bj.bcebos.com/object_detection/solov2_r101_vd_fpn_3x.pdparams) | [config](https://github.com/PaddlePaddle/PaddleDetection/tree/master/configs/solov2/solov2_r101_vd_fpn_3x.yml) |
## Enhanced model ## Enhanced model
| Backbone | Input size | Lr schd | V100 FP32(FPS) | Mask AP | Download | Configs | | Backbone | Input size | Lr schd | V100 FP32(FPS) | Mask AP<sup>val</sup> | Download | Configs |
| :---------------------: | :-------------------: | :-----: | :------------: | :-----: | :---------: | :------------------------: | | :---------------------: | :-------------------: | :-----: | :------------: | :-----: | :---------: | :------------------------: |
| Light-R50-VD-DCN-FPN | 512 | 3x | 38.6 | 38.8 | [model](https://paddlemodels.bj.bcebos.com/object_detection/solov2_light_r50_vd_fpn_dcn_512_3x.pdparams) | [config](https://github.com/PaddlePaddle/PaddleDetection/tree/master/configs/solov2/solov2_light_r50_vd_fpn_dcn_512_3x.yml) | | Light-R50-VD-DCN-FPN | 512 | 3x | 38.6 | 38.8 | [model](https://paddlemodels.bj.bcebos.com/object_detection/solov2_light_r50_vd_fpn_dcn_512_3x.pdparams) | [config](https://github.com/PaddlePaddle/PaddleDetection/tree/master/configs/solov2/solov2_light_r50_vd_fpn_dcn_512_3x.yml) |
**Notes:**
- SOLOv2 is trained on COCO train2017 dataset and evaluated on val2017 results of `mAP(IoU=0.5:0.95)`.
## Citations ## Citations
``` ```
@article{wang2020solov2, @article{wang2020solov2,
......
...@@ -20,8 +20,9 @@ SOLOv2: ...@@ -20,8 +20,9 @@ SOLOv2:
ResNet: ResNet:
depth: 50 depth: 50
feature_maps: [2, 3, 4, 5] feature_maps: [2, 3, 4, 5]
freeze_at: 2 freeze_at: 0
norm_type: bn freeze_norm: false
norm_type: sync_bn
dcn_v2_stages: [3, 4, 5] dcn_v2_stages: [3, 4, 5]
variant: d variant: d
lr_mult_list: [0.05, 0.05, 0.1, 0.15] lr_mult_list: [0.05, 0.05, 0.1, 0.15]
......
...@@ -26,6 +26,7 @@ import paddle ...@@ -26,6 +26,7 @@ import paddle
import paddle.fluid as fluid import paddle.fluid as fluid
from preprocess import preprocess, Resize, Normalize, Permute, PadStride from preprocess import preprocess, Resize, Normalize, Permute, PadStride
from visualize import visualize_box_mask from visualize import visualize_box_mask
from ppdet.utils.check import enable_static_mode
# Global dictionary # Global dictionary
SUPPORT_MODELS = { SUPPORT_MODELS = {
...@@ -512,7 +513,7 @@ def main(): ...@@ -512,7 +513,7 @@ def main():
if __name__ == '__main__': if __name__ == '__main__':
paddle.enable_static() enable_static_mode()
parser = argparse.ArgumentParser(description=__doc__) parser = argparse.ArgumentParser(description=__doc__)
parser.add_argument( parser.add_argument(
"--model_dir", "--model_dir",
......
...@@ -24,6 +24,7 @@ if parent_path not in sys.path: ...@@ -24,6 +24,7 @@ if parent_path not in sys.path:
sys.path.append(parent_path) sys.path.append(parent_path)
from ppdet.data.parallel_map import ParallelMap from ppdet.data.parallel_map import ParallelMap
from ppdet.utils.check import enable_static_mode
class MemorySource(object): class MemorySource(object):
...@@ -146,7 +147,6 @@ class TestDataset(unittest.TestCase): ...@@ -146,7 +147,6 @@ class TestDataset(unittest.TestCase):
if __name__ == '__main__': if __name__ == '__main__':
import paddle enable_static_mode()
paddle.enable_static()
logging.basicConfig() logging.basicConfig()
unittest.main() unittest.main()
...@@ -27,6 +27,7 @@ from ppdet.utils.download import DATASET_HOME ...@@ -27,6 +27,7 @@ from ppdet.utils.download import DATASET_HOME
from ppdet.data.transform.operators import DecodeImage, ResizeImage, Permute from ppdet.data.transform.operators import DecodeImage, ResizeImage, Permute
from ppdet.data.transform.batch_operators import PadBatch from ppdet.data.transform.batch_operators import PadBatch
from ppdet.utils.check import enable_static_mode
COCO_VAL_URL = 'http://images.cocodataset.org/zips/val2017.zip' COCO_VAL_URL = 'http://images.cocodataset.org/zips/val2017.zip'
COCO_VAL_MD5SUM = '442b8da7639aecaf257c1dceb8ba8c80' COCO_VAL_MD5SUM = '442b8da7639aecaf257c1dceb8ba8c80'
...@@ -168,6 +169,5 @@ class TestReader(unittest.TestCase): ...@@ -168,6 +169,5 @@ class TestReader(unittest.TestCase):
if __name__ == '__main__': if __name__ == '__main__':
import paddle enable_static_mode()
paddle.enable_static()
unittest.main() unittest.main()
...@@ -27,6 +27,7 @@ from ppdet.utils.download import DATASET_HOME ...@@ -27,6 +27,7 @@ from ppdet.utils.download import DATASET_HOME
from ppdet.core.workspace import load_config, merge_config from ppdet.core.workspace import load_config, merge_config
from ppdet.data.reader import create_reader from ppdet.data.reader import create_reader
from ppdet.utils.check import enable_static_mode
COCO_VAL_URL = 'http://images.cocodataset.org/zips/val2017.zip' COCO_VAL_URL = 'http://images.cocodataset.org/zips/val2017.zip'
COCO_VAL_MD5SUM = '442b8da7639aecaf257c1dceb8ba8c80' COCO_VAL_MD5SUM = '442b8da7639aecaf257c1dceb8ba8c80'
...@@ -112,6 +113,5 @@ class TestReaderYAML(unittest.TestCase): ...@@ -112,6 +113,5 @@ class TestReaderYAML(unittest.TestCase):
if __name__ == '__main__': if __name__ == '__main__':
import paddle enable_static_mode()
paddle.enable_static()
unittest.main() unittest.main()
...@@ -25,6 +25,7 @@ if parent_path not in sys.path: ...@@ -25,6 +25,7 @@ if parent_path not in sys.path:
sys.path.append(parent_path) sys.path.append(parent_path)
from ppdet.ext_op import cornerpool_lib from ppdet.ext_op import cornerpool_lib
from ppdet.utils.check import enable_static_mode
def bottom_pool_np(x): def bottom_pool_np(x):
...@@ -120,6 +121,5 @@ class TestLeftPoolOp(TestRightPoolOp): ...@@ -120,6 +121,5 @@ class TestLeftPoolOp(TestRightPoolOp):
if __name__ == "__main__": if __name__ == "__main__":
import paddle enable_static_mode()
paddle.enable_static()
unittest.main() unittest.main()
...@@ -71,7 +71,7 @@ class SOLOv2Head(object): ...@@ -71,7 +71,7 @@ class SOLOv2Head(object):
kernel='gaussian', kernel='gaussian',
sigma=2.0).__dict__, sigma=2.0).__dict__,
drop_block=False): drop_block=False):
check_version('2.0.0') check_version('2.0.0-rc0')
self.num_classes = num_classes self.num_classes = num_classes
self.seg_num_grids = num_grids self.seg_num_grids = num_grids
self.cate_out_channels = self.num_classes - 1 self.cate_out_channels = self.num_classes - 1
......
...@@ -30,6 +30,7 @@ if parent_path not in sys.path: ...@@ -30,6 +30,7 @@ if parent_path not in sys.path:
from ppdet.modeling.tests.decorator_helper import prog_scope from ppdet.modeling.tests.decorator_helper import prog_scope
from ppdet.core.workspace import load_config, merge_config, create from ppdet.core.workspace import load_config, merge_config, create
from ppdet.utils.check import enable_static_mode
class TestFasterRCNN(unittest.TestCase): class TestFasterRCNN(unittest.TestCase):
...@@ -91,5 +92,5 @@ class TestSSD(TestFasterRCNN): ...@@ -91,5 +92,5 @@ class TestSSD(TestFasterRCNN):
if __name__ == '__main__': if __name__ == '__main__':
paddle.enable_static() enable_static_mode()
unittest.main() unittest.main()
...@@ -18,6 +18,7 @@ from __future__ import print_function ...@@ -18,6 +18,7 @@ from __future__ import print_function
import sys import sys
import paddle
import paddle.fluid as fluid import paddle.fluid as fluid
import logging import logging
...@@ -126,3 +127,10 @@ def check_py_func(program): ...@@ -126,3 +127,10 @@ def check_py_func(program):
"if you use MultiClassSoftNMS, better to replace it by "\ "if you use MultiClassSoftNMS, better to replace it by "\
"MultiClassNMS.".format(input_arg, output_arg) "MultiClassNMS.".format(input_arg, output_arg)
raise Exception(err) raise Exception(err)
def enable_static_mode():
try:
paddle.enable_static()
except:
pass
...@@ -33,7 +33,7 @@ from ppdet.data.reader import create_reader ...@@ -33,7 +33,7 @@ from ppdet.data.reader import create_reader
from ppdet.utils.eval_utils import parse_fetches, eval_results, eval_run from ppdet.utils.eval_utils import parse_fetches, eval_results, eval_run
from ppdet.utils.stats import TrainingStats from ppdet.utils.stats import TrainingStats
from ppdet.utils.cli import ArgsParser from ppdet.utils.cli import ArgsParser
from ppdet.utils.check import check_gpu, check_version, check_config from ppdet.utils.check import check_gpu, check_version, check_config, enable_static_mode
import ppdet.utils.checkpoint as checkpoint import ppdet.utils.checkpoint as checkpoint
import logging import logging
...@@ -372,7 +372,7 @@ def main(): ...@@ -372,7 +372,7 @@ def main():
if __name__ == '__main__': if __name__ == '__main__':
paddle.enable_static() enable_static_mode()
parser = ArgsParser() parser = ArgsParser()
parser.add_argument( parser.add_argument(
"-r", "-r",
......
...@@ -36,7 +36,7 @@ from ppdet.data.reader import create_reader ...@@ -36,7 +36,7 @@ from ppdet.data.reader import create_reader
from ppdet.utils.eval_utils import parse_fetches, eval_results, eval_run from ppdet.utils.eval_utils import parse_fetches, eval_results, eval_run
from ppdet.utils.stats import TrainingStats from ppdet.utils.stats import TrainingStats
from ppdet.utils.cli import ArgsParser from ppdet.utils.cli import ArgsParser
from ppdet.utils.check import check_gpu, check_version, check_config from ppdet.utils.check import check_gpu, check_version, check_config, enable_static_mode
import ppdet.utils.checkpoint as checkpoint import ppdet.utils.checkpoint as checkpoint
import logging import logging
...@@ -360,7 +360,7 @@ def main(): ...@@ -360,7 +360,7 @@ def main():
if __name__ == '__main__': if __name__ == '__main__':
paddle.enable_static() enable_static_mode()
parser = ArgsParser() parser = ArgsParser()
parser.add_argument( parser.add_argument(
"-t", "-t",
......
...@@ -38,7 +38,7 @@ from ppdet.utils import dist_utils ...@@ -38,7 +38,7 @@ from ppdet.utils import dist_utils
from ppdet.utils.eval_utils import parse_fetches, eval_run from ppdet.utils.eval_utils import parse_fetches, eval_run
from ppdet.utils.stats import TrainingStats from ppdet.utils.stats import TrainingStats
from ppdet.utils.cli import ArgsParser from ppdet.utils.cli import ArgsParser
from ppdet.utils.check import check_gpu, check_version, check_config from ppdet.utils.check import check_gpu, check_version, check_config, enable_static_mode
import ppdet.utils.checkpoint as checkpoint import ppdet.utils.checkpoint as checkpoint
from paddleslim.analysis import flops, TableLatencyEvaluator from paddleslim.analysis import flops, TableLatencyEvaluator
from paddleslim.nas import SANAS from paddleslim.nas import SANAS
...@@ -379,7 +379,7 @@ def main(): ...@@ -379,7 +379,7 @@ def main():
if __name__ == '__main__': if __name__ == '__main__':
paddle.enable_static() enable_static_mode()
parser = ArgsParser() parser = ArgsParser()
parser.add_argument( parser.add_argument(
"-r", "-r",
......
...@@ -30,7 +30,7 @@ from paddleslim.analysis import flops ...@@ -30,7 +30,7 @@ from paddleslim.analysis import flops
from ppdet.utils.eval_utils import parse_fetches, eval_run, eval_results, json_eval_results from ppdet.utils.eval_utils import parse_fetches, eval_run, eval_results, json_eval_results
import ppdet.utils.checkpoint as checkpoint import ppdet.utils.checkpoint as checkpoint
from ppdet.utils.check import check_gpu, check_version, check_config from ppdet.utils.check import check_gpu, check_version, check_config, enable_static_mode
from ppdet.data.reader import create_reader from ppdet.data.reader import create_reader
...@@ -200,7 +200,7 @@ def main(): ...@@ -200,7 +200,7 @@ def main():
if __name__ == '__main__': if __name__ == '__main__':
paddle.enable_static() enable_static_mode()
parser = ArgsParser() parser = ArgsParser()
parser.add_argument( parser.add_argument(
"--json_eval", "--json_eval",
......
...@@ -29,7 +29,7 @@ from ppdet.core.workspace import load_config, merge_config, create ...@@ -29,7 +29,7 @@ from ppdet.core.workspace import load_config, merge_config, create
from ppdet.utils.cli import ArgsParser from ppdet.utils.cli import ArgsParser
import ppdet.utils.checkpoint as checkpoint import ppdet.utils.checkpoint as checkpoint
from ppdet.utils.export_utils import save_infer_model, dump_infer_config from ppdet.utils.export_utils import save_infer_model, dump_infer_config
from ppdet.utils.check import check_config, check_version from ppdet.utils.check import check_config, check_version, enable_static_mode
from paddleslim.prune import Pruner from paddleslim.prune import Pruner
from paddleslim.analysis import flops from paddleslim.analysis import flops
...@@ -98,7 +98,7 @@ def main(): ...@@ -98,7 +98,7 @@ def main():
if __name__ == '__main__': if __name__ == '__main__':
paddle.enable_static() enable_static_mode()
parser = ArgsParser() parser = ArgsParser()
parser.add_argument( parser.add_argument(
"--output_dir", "--output_dir",
......
...@@ -35,7 +35,7 @@ from ppdet.core.workspace import load_config, merge_config, create ...@@ -35,7 +35,7 @@ from ppdet.core.workspace import load_config, merge_config, create
from ppdet.utils.eval_utils import parse_fetches from ppdet.utils.eval_utils import parse_fetches
from ppdet.utils.cli import ArgsParser from ppdet.utils.cli import ArgsParser
from ppdet.utils.check import check_gpu, check_version, check_config from ppdet.utils.check import check_gpu, check_version, check_config, enable_static_mode
from ppdet.utils.visualizer import visualize_results from ppdet.utils.visualizer import visualize_results
import ppdet.utils.checkpoint as checkpoint import ppdet.utils.checkpoint as checkpoint
...@@ -224,7 +224,7 @@ def main(): ...@@ -224,7 +224,7 @@ def main():
if __name__ == '__main__': if __name__ == '__main__':
paddle.enable_static() enable_static_mode()
parser = ArgsParser() parser = ArgsParser()
parser.add_argument( parser.add_argument(
"--infer_dir", "--infer_dir",
......
...@@ -39,7 +39,7 @@ from ppdet.utils import dist_utils ...@@ -39,7 +39,7 @@ from ppdet.utils import dist_utils
from ppdet.utils.eval_utils import parse_fetches, eval_run, eval_results from ppdet.utils.eval_utils import parse_fetches, eval_run, eval_results
from ppdet.utils.stats import TrainingStats from ppdet.utils.stats import TrainingStats
from ppdet.utils.cli import ArgsParser from ppdet.utils.cli import ArgsParser
from ppdet.utils.check import check_gpu, check_version, check_config from ppdet.utils.check import check_gpu, check_version, check_config, enable_static_mode
import ppdet.utils.checkpoint as checkpoint import ppdet.utils.checkpoint as checkpoint
import logging import logging
...@@ -348,7 +348,7 @@ def main(): ...@@ -348,7 +348,7 @@ def main():
if __name__ == '__main__': if __name__ == '__main__':
paddle.enable_static() enable_static_mode()
parser = ArgsParser() parser = ArgsParser()
parser.add_argument( parser.add_argument(
"-r", "-r",
......
...@@ -28,7 +28,7 @@ import paddle.fluid as fluid ...@@ -28,7 +28,7 @@ import paddle.fluid as fluid
from ppdet.utils.eval_utils import parse_fetches, eval_run, eval_results, json_eval_results from ppdet.utils.eval_utils import parse_fetches, eval_run, eval_results, json_eval_results
import ppdet.utils.checkpoint as checkpoint import ppdet.utils.checkpoint as checkpoint
from ppdet.utils.check import check_gpu, check_version, check_config from ppdet.utils.check import check_gpu, check_version, check_config, enable_static_mode
from ppdet.data.reader import create_reader from ppdet.data.reader import create_reader
...@@ -157,7 +157,7 @@ def main(): ...@@ -157,7 +157,7 @@ def main():
if __name__ == '__main__': if __name__ == '__main__':
paddle.enable_static() enable_static_mode()
parser = ArgsParser() parser = ArgsParser()
parser.add_argument( parser.add_argument(
"--json_eval", "--json_eval",
......
...@@ -29,7 +29,7 @@ from ppdet.core.workspace import load_config, merge_config, create ...@@ -29,7 +29,7 @@ from ppdet.core.workspace import load_config, merge_config, create
from ppdet.utils.cli import ArgsParser from ppdet.utils.cli import ArgsParser
import ppdet.utils.checkpoint as checkpoint import ppdet.utils.checkpoint as checkpoint
from ppdet.utils.export_utils import save_infer_model, dump_infer_config from ppdet.utils.export_utils import save_infer_model, dump_infer_config
from ppdet.utils.check import check_config, check_version from ppdet.utils.check import check_config, check_version, enable_static_mode
import logging import logging
FORMAT = '%(asctime)s-%(levelname)s: %(message)s' FORMAT = '%(asctime)s-%(levelname)s: %(message)s'
...@@ -88,7 +88,7 @@ def main(): ...@@ -88,7 +88,7 @@ def main():
if __name__ == '__main__': if __name__ == '__main__':
paddle.enable_static() enable_static_mode()
parser = ArgsParser() parser = ArgsParser()
parser.add_argument( parser.add_argument(
"--output_dir", "--output_dir",
......
...@@ -32,7 +32,7 @@ from paddle import fluid ...@@ -32,7 +32,7 @@ from paddle import fluid
from ppdet.core.workspace import load_config, merge_config, create from ppdet.core.workspace import load_config, merge_config, create
from ppdet.utils.eval_utils import parse_fetches from ppdet.utils.eval_utils import parse_fetches
from ppdet.utils.cli import ArgsParser from ppdet.utils.cli import ArgsParser
from ppdet.utils.check import check_gpu, check_version, check_config from ppdet.utils.check import check_gpu, check_version, check_config, enable_static_mode
from ppdet.utils.visualizer import visualize_results from ppdet.utils.visualizer import visualize_results
import ppdet.utils.checkpoint as checkpoint import ppdet.utils.checkpoint as checkpoint
...@@ -169,7 +169,7 @@ def main(): ...@@ -169,7 +169,7 @@ def main():
if __name__ == '__main__': if __name__ == '__main__':
paddle.enable_static() enable_static_mode()
parser = ArgsParser() parser = ArgsParser()
parser.add_argument( parser.add_argument(
"--infer_dir", "--infer_dir",
......
...@@ -37,7 +37,7 @@ from ppdet.utils import dist_utils ...@@ -37,7 +37,7 @@ from ppdet.utils import dist_utils
from ppdet.utils.eval_utils import parse_fetches, eval_run, eval_results from ppdet.utils.eval_utils import parse_fetches, eval_run, eval_results
from ppdet.utils.stats import TrainingStats from ppdet.utils.stats import TrainingStats
from ppdet.utils.cli import ArgsParser from ppdet.utils.cli import ArgsParser
from ppdet.utils.check import check_gpu, check_version, check_config from ppdet.utils.check import check_gpu, check_version, check_config, enable_static_mode
import ppdet.utils.checkpoint as checkpoint import ppdet.utils.checkpoint as checkpoint
from paddleslim.quant import quant_aware, convert from paddleslim.quant import quant_aware, convert
from pact import pact, get_optimizer from pact import pact, get_optimizer
...@@ -303,7 +303,7 @@ def main(): ...@@ -303,7 +303,7 @@ def main():
if __name__ == '__main__': if __name__ == '__main__':
paddle.enable_static() enable_static_mode()
parser = ArgsParser() parser = ArgsParser()
parser.add_argument( parser.add_argument(
"--loss_scale", "--loss_scale",
......
...@@ -38,7 +38,7 @@ from ppdet.utils import dist_utils ...@@ -38,7 +38,7 @@ from ppdet.utils import dist_utils
from ppdet.utils.eval_utils import parse_fetches, eval_run, eval_results from ppdet.utils.eval_utils import parse_fetches, eval_run, eval_results
from ppdet.utils.stats import TrainingStats from ppdet.utils.stats import TrainingStats
from ppdet.utils.cli import ArgsParser from ppdet.utils.cli import ArgsParser
from ppdet.utils.check import check_gpu, check_version, check_config from ppdet.utils.check import check_gpu, check_version, check_config, enable_static_mode
import ppdet.utils.checkpoint as checkpoint import ppdet.utils.checkpoint as checkpoint
from paddleslim.prune import sensitivity from paddleslim.prune import sensitivity
import logging import logging
...@@ -168,7 +168,7 @@ def main(): ...@@ -168,7 +168,7 @@ def main():
if __name__ == '__main__': if __name__ == '__main__':
paddle.enable_static() enable_static_mode()
parser = ArgsParser() parser = ArgsParser()
parser.add_argument( parser.add_argument(
"--output_eval", "--output_eval",
......
...@@ -27,7 +27,7 @@ import paddle.fluid as fluid ...@@ -27,7 +27,7 @@ import paddle.fluid as fluid
from ppdet.utils.eval_utils import parse_fetches, eval_run, eval_results, json_eval_results from ppdet.utils.eval_utils import parse_fetches, eval_run, eval_results, json_eval_results
import ppdet.utils.checkpoint as checkpoint import ppdet.utils.checkpoint as checkpoint
from ppdet.utils.check import check_gpu, check_version, check_config from ppdet.utils.check import check_gpu, check_version, check_config, enable_static_mode
from ppdet.data.reader import create_reader from ppdet.data.reader import create_reader
...@@ -162,7 +162,7 @@ def main(): ...@@ -162,7 +162,7 @@ def main():
if __name__ == '__main__': if __name__ == '__main__':
paddle.enable_static() enable_static_mode()
parser = ArgsParser() parser = ArgsParser()
parser.add_argument( parser.add_argument(
"--json_eval", "--json_eval",
......
...@@ -30,7 +30,7 @@ from ppdet.core.workspace import load_config, merge_config, create ...@@ -30,7 +30,7 @@ from ppdet.core.workspace import load_config, merge_config, create
from ppdet.utils.cli import ArgsParser from ppdet.utils.cli import ArgsParser
import ppdet.utils.checkpoint as checkpoint import ppdet.utils.checkpoint as checkpoint
from ppdet.utils.export_utils import save_infer_model, dump_infer_config from ppdet.utils.export_utils import save_infer_model, dump_infer_config
from ppdet.utils.check import check_config, check_version, check_py_func from ppdet.utils.check import check_config, check_version, check_py_func, enable_static_mode
import logging import logging
FORMAT = '%(asctime)s-%(levelname)s: %(message)s' FORMAT = '%(asctime)s-%(levelname)s: %(message)s'
logging.basicConfig(level=logging.INFO, format=FORMAT) logging.basicConfig(level=logging.INFO, format=FORMAT)
...@@ -72,7 +72,7 @@ def main(): ...@@ -72,7 +72,7 @@ def main():
if __name__ == '__main__': if __name__ == '__main__':
paddle.enable_static() enable_static_mode()
parser = ArgsParser() parser = ArgsParser()
parser.add_argument( parser.add_argument(
"--output_dir", "--output_dir",
......
...@@ -27,7 +27,7 @@ from paddle import fluid ...@@ -27,7 +27,7 @@ from paddle import fluid
from ppdet.core.workspace import load_config, merge_config, create from ppdet.core.workspace import load_config, merge_config, create
from ppdet.utils.cli import ArgsParser from ppdet.utils.cli import ArgsParser
from ppdet.utils.check import check_config, check_version from ppdet.utils.check import check_config, check_version, enable_static_mode
import ppdet.utils.checkpoint as checkpoint import ppdet.utils.checkpoint as checkpoint
import yaml import yaml
import logging import logging
...@@ -95,7 +95,7 @@ def main(): ...@@ -95,7 +95,7 @@ def main():
if __name__ == '__main__': if __name__ == '__main__':
paddle.enable_static() enable_static_mode()
parser = ArgsParser() parser = ArgsParser()
parser.add_argument( parser.add_argument(
"--output_dir", "--output_dir",
......
...@@ -31,7 +31,7 @@ from collections import OrderedDict ...@@ -31,7 +31,7 @@ from collections import OrderedDict
import ppdet.utils.checkpoint as checkpoint import ppdet.utils.checkpoint as checkpoint
from ppdet.utils.cli import ArgsParser from ppdet.utils.cli import ArgsParser
from ppdet.utils.check import check_gpu, check_version, check_config from ppdet.utils.check import check_gpu, check_version, check_config, enable_static_mode
from ppdet.utils.widerface_eval_utils import get_shrink, bbox_vote, \ from ppdet.utils.widerface_eval_utils import get_shrink, bbox_vote, \
save_widerface_bboxes, save_fddb_bboxes, to_chw_bgr save_widerface_bboxes, save_fddb_bboxes, to_chw_bgr
from ppdet.core.workspace import load_config, merge_config, create from ppdet.core.workspace import load_config, merge_config, create
...@@ -271,7 +271,7 @@ def main(): ...@@ -271,7 +271,7 @@ def main():
if __name__ == '__main__': if __name__ == '__main__':
paddle.enable_static() enable_static_mode()
parser = ArgsParser() parser = ArgsParser()
parser.add_argument( parser.add_argument(
"-f", "-f",
......
...@@ -34,7 +34,7 @@ from ppdet.core.workspace import load_config, merge_config, create ...@@ -34,7 +34,7 @@ from ppdet.core.workspace import load_config, merge_config, create
from ppdet.utils.eval_utils import parse_fetches from ppdet.utils.eval_utils import parse_fetches
from ppdet.utils.cli import ArgsParser from ppdet.utils.cli import ArgsParser
from ppdet.utils.check import check_gpu, check_version, check_config from ppdet.utils.check import check_gpu, check_version, check_config, enable_static_mode
from ppdet.utils.visualizer import visualize_results from ppdet.utils.visualizer import visualize_results
import ppdet.utils.checkpoint as checkpoint import ppdet.utils.checkpoint as checkpoint
...@@ -234,7 +234,7 @@ def main(): ...@@ -234,7 +234,7 @@ def main():
if __name__ == '__main__': if __name__ == '__main__':
paddle.enable_static() enable_static_mode()
parser = ArgsParser() parser = ArgsParser()
parser.add_argument( parser.add_argument(
"--infer_dir", "--infer_dir",
......
...@@ -43,7 +43,7 @@ from ppdet.utils import dist_utils ...@@ -43,7 +43,7 @@ from ppdet.utils import dist_utils
from ppdet.utils.eval_utils import parse_fetches, eval_run, eval_results from ppdet.utils.eval_utils import parse_fetches, eval_run, eval_results
from ppdet.utils.stats import TrainingStats from ppdet.utils.stats import TrainingStats
from ppdet.utils.cli import ArgsParser from ppdet.utils.cli import ArgsParser
from ppdet.utils.check import check_gpu, check_version, check_config from ppdet.utils.check import check_gpu, check_version, check_config, enable_static_mode
import ppdet.utils.checkpoint as checkpoint import ppdet.utils.checkpoint as checkpoint
import logging import logging
...@@ -317,7 +317,7 @@ def main(): ...@@ -317,7 +317,7 @@ def main():
if __name__ == '__main__': if __name__ == '__main__':
paddle.enable_static() enable_static_mode()
parser = ArgsParser() parser = ArgsParser()
parser.add_argument( parser.add_argument(
"-r", "-r",
......
...@@ -43,7 +43,7 @@ from ppdet.utils import dist_utils ...@@ -43,7 +43,7 @@ from ppdet.utils import dist_utils
from ppdet.utils.eval_utils import parse_fetches, eval_run, eval_results from ppdet.utils.eval_utils import parse_fetches, eval_run, eval_results
from ppdet.utils.stats import TrainingStats from ppdet.utils.stats import TrainingStats
from ppdet.utils.cli import ArgsParser from ppdet.utils.cli import ArgsParser
from ppdet.utils.check import check_gpu, check_version, check_config from ppdet.utils.check import check_gpu, check_version, check_config, enable_static_mode
import ppdet.utils.checkpoint as checkpoint import ppdet.utils.checkpoint as checkpoint
from paddle.fluid.incubate.fleet.collective import fleet, DistributedStrategy # new line 1 from paddle.fluid.incubate.fleet.collective import fleet, DistributedStrategy # new line 1
...@@ -310,7 +310,7 @@ def main(): ...@@ -310,7 +310,7 @@ def main():
if __name__ == '__main__': if __name__ == '__main__':
paddle.enable_static() enable_static_mode()
parser = ArgsParser() parser = ArgsParser()
parser.add_argument( parser.add_argument(
"-r", "-r",
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册