diff --git a/slim/distillation/distill.py b/slim/distillation/distill.py index 59e5593ec43f8bd1dd89225f608e4ca49f16918a..f95fc264e6cf81bcb1c04122731b1e524679437b 100644 --- a/slim/distillation/distill.py +++ b/slim/distillation/distill.py @@ -32,7 +32,7 @@ from ppdet.data.reader import create_reader from ppdet.utils.eval_utils import parse_fetches, eval_results, eval_run from ppdet.utils.stats import TrainingStats from ppdet.utils.cli import ArgsParser -from ppdet.utils.check import check_gpu, check_config +from ppdet.utils.check import check_gpu, check_version, check_config import ppdet.utils.checkpoint as checkpoint import logging @@ -134,6 +134,7 @@ def main(): check_config(cfg) # check if set use_gpu=True in paddlepaddle cpu version check_gpu(cfg.use_gpu) + check_version() main_arch = cfg.architecture diff --git a/slim/extensions/distill_pruned_model/distill_pruned_model.py b/slim/extensions/distill_pruned_model/distill_pruned_model.py index 3302f278cec21d92260c68f039a820d83456a172..71059202c20901d067e3a7519a7b1fb9a59ca01e 100644 --- a/slim/extensions/distill_pruned_model/distill_pruned_model.py +++ b/slim/extensions/distill_pruned_model/distill_pruned_model.py @@ -35,7 +35,7 @@ from ppdet.data.reader import create_reader from ppdet.utils.eval_utils import parse_fetches, eval_results, eval_run from ppdet.utils.stats import TrainingStats from ppdet.utils.cli import ArgsParser -from ppdet.utils.check import check_gpu, check_config +from ppdet.utils.check import check_gpu, check_version, check_config import ppdet.utils.checkpoint as checkpoint import logging @@ -123,6 +123,7 @@ def main(): check_config(cfg) # check if set use_gpu=True in paddlepaddle cpu version check_gpu(cfg.use_gpu) + check_version() main_arch = cfg.architecture diff --git a/slim/prune/export_model.py b/slim/prune/export_model.py index 808af9f3b0a7be1b0ed7c76481d0c67c3ddddc46..bc07c637d96840bad67ce1f95a999e6fea6519ae 100644 --- a/slim/prune/export_model.py +++ b/slim/prune/export_model.py @@ -27,7 +27,7 @@ from paddle import fluid from ppdet.core.workspace import load_config, merge_config, create from ppdet.utils.cli import ArgsParser import ppdet.utils.checkpoint as checkpoint -from ppdet.utils.check import check_config +from ppdet.utils.check import check_config, check_version from paddleslim.prune import Pruner from paddleslim.analysis import flops @@ -82,6 +82,7 @@ def main(): cfg = load_config(FLAGS.config) merge_config(FLAGS.opt) check_config(cfg) + check_version() main_arch = cfg.architecture diff --git a/slim/quantization/export_model.py b/slim/quantization/export_model.py index ab219fa3c853ec3fa7de09f16d8549a31633db6d..0a9950f593c1776c0a35fb92bf7b38e1f08d67f9 100644 --- a/slim/quantization/export_model.py +++ b/slim/quantization/export_model.py @@ -27,7 +27,7 @@ from paddle import fluid from ppdet.core.workspace import load_config, merge_config, create from ppdet.utils.cli import ArgsParser import ppdet.utils.checkpoint as checkpoint -from ppdet.utils.check import check_config +from ppdet.utils.check import check_config, check_version from tools.export_model import prune_feed_vars import logging @@ -57,6 +57,7 @@ def main(): cfg = load_config(FLAGS.config) merge_config(FLAGS.opt) check_config(cfg) + check_version() main_arch = cfg.architecture diff --git a/slim/sensitive/sensitive.py b/slim/sensitive/sensitive.py index d57699ad3b3026eff7ce8c7cfbf3222fe11bdf50..23581fead69ccacc706f56e80aa8d75f4f6e75c0 100644 --- a/slim/sensitive/sensitive.py +++ b/slim/sensitive/sensitive.py @@ -53,6 +53,7 @@ def main(): cfg = load_config(FLAGS.config) merge_config(FLAGS.opt) check_config(cfg) + check_version() main_arch = cfg.architecture diff --git a/tools/export_model.py b/tools/export_model.py index 8cadb912ddd6c2ca1bc6f1edf3914640556bdad1..2cdf9c58daae03a5b47f33224d54461d28130f7a 100644 --- a/tools/export_model.py +++ b/tools/export_model.py @@ -28,7 +28,7 @@ from paddle import fluid from ppdet.core.workspace import load_config, merge_config, create from ppdet.utils.cli import ArgsParser import ppdet.utils.checkpoint as checkpoint -from ppdet.utils.check import check_config +from ppdet.utils.check import check_config, check_version import yaml import logging from collections import OrderedDict @@ -176,6 +176,8 @@ def main(): merge_config(FLAGS.opt) check_config(cfg) + check_version() + main_arch = cfg.architecture # Use CPU for exporting inference model instead of GPU diff --git a/tools/export_serving_model.py b/tools/export_serving_model.py index 725f0fe44f5947737de45b1ea68d406fbe156928..112acd5524494845f847b46629924b81e192a42e 100644 --- a/tools/export_serving_model.py +++ b/tools/export_serving_model.py @@ -22,7 +22,7 @@ from paddle import fluid from ppdet.core.workspace import load_config, merge_config, create from ppdet.utils.cli import ArgsParser -from ppdet.utils.check import check_config +from ppdet.utils.check import check_config, check_version import ppdet.utils.checkpoint as checkpoint import yaml import logging @@ -58,6 +58,7 @@ def main(): cfg = load_config(FLAGS.config) merge_config(FLAGS.opt) check_config(cfg) + check_version() main_arch = cfg.architecture diff --git a/tools/face_eval.py b/tools/face_eval.py index 41545760a8544f8da5465e87fe10cbed0258dc34..a32eb6a57d78d9a93b5e098f67d580189f663c9e 100644 --- a/tools/face_eval.py +++ b/tools/face_eval.py @@ -30,7 +30,7 @@ from collections import OrderedDict import ppdet.utils.checkpoint as checkpoint from ppdet.utils.cli import ArgsParser -from ppdet.utils.check import check_gpu, check_config +from ppdet.utils.check import check_gpu, check_version, check_config from ppdet.utils.widerface_eval_utils import get_shrink, bbox_vote, \ save_widerface_bboxes, save_fddb_bboxes, to_chw_bgr from ppdet.core.workspace import load_config, merge_config, create @@ -219,6 +219,7 @@ def main(): check_config(cfg) # check if set use_gpu=True in paddlepaddle cpu version check_gpu(cfg.use_gpu) + check_version() main_arch = cfg.architecture