From b716eddcfb3700bb36761915a1f363cc582cf212 Mon Sep 17 00:00:00 2001 From: LutaoChu <30695251+LutaoChu@users.noreply.github.com> Date: Thu, 31 Oct 2019 10:39:27 +0800 Subject: [PATCH] "if args.opts is not None:" change to "if args.opts:" (#75) * fix bug --- pdseg/eval.py | 2 +- pdseg/export_model.py | 2 +- pdseg/train.py | 2 +- pdseg/vis.py | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/pdseg/eval.py b/pdseg/eval.py index 815ebf56..54ff853c 100644 --- a/pdseg/eval.py +++ b/pdseg/eval.py @@ -165,7 +165,7 @@ def main(): args = parse_args() if args.cfg_file is not None: cfg.update_from_file(args.cfg_file) - if args.opts is not None: + if args.opts: cfg.update_from_list(args.opts) cfg.check_and_infer() print(pprint.pformat(cfg)) diff --git a/pdseg/export_model.py b/pdseg/export_model.py index 27423bb7..410cfc33 100644 --- a/pdseg/export_model.py +++ b/pdseg/export_model.py @@ -116,7 +116,7 @@ def main(): args = parse_args() if args.cfg_file is not None: cfg.update_from_file(args.cfg_file) - if args.opts is not None: + if args.opts: cfg.update_from_list(args.opts) cfg.check_and_infer() print(pprint.pformat(cfg)) diff --git a/pdseg/train.py b/pdseg/train.py index 9db3648c..cf7baa0f 100644 --- a/pdseg/train.py +++ b/pdseg/train.py @@ -447,7 +447,7 @@ def train(cfg): def main(args): if args.cfg_file is not None: cfg.update_from_file(args.cfg_file) - if args.opts is not None: + if args.opts: cfg.update_from_list(args.opts) cfg.check_and_infer() print(pprint.pformat(cfg)) diff --git a/pdseg/vis.py b/pdseg/vis.py index e798f2ed..7806ce5d 100644 --- a/pdseg/vis.py +++ b/pdseg/vis.py @@ -260,7 +260,7 @@ if __name__ == '__main__': args = parse_args() if args.cfg_file is not None: cfg.update_from_file(args.cfg_file) - if args.opts is not None: + if args.opts: cfg.update_from_list(args.opts) cfg.check_and_infer() print(pprint.pformat(cfg)) -- GitLab