[Fix] Fix bug which breaks `cal_train_time` in `analyze_logs.py`. (#662)

* fix bug mmclassification issues 661

https://github.com/open-mmlab/mmclassification/issues/661

* fix lint

Co-authored-by: Zhicheng Chen <chen1319276472@foxmail.com>
pull/685/head
xiefeifeihu 2022-01-19 18:38:48 +08:00 committed by GitHub
parent 32d606e1a1
commit d73eb01cba
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 1 additions and 1 deletions

View File

@ -193,7 +193,7 @@ def parse_args():
add_time_parser(subparsers)
args = parser.parse_args()
if args.window_size != '':
if hasattr(args, 'window_size') and args.window_size != '':
assert re.match(r'\d+\*\d+', args.window_size), \
"'window-size' must be in format 'W*H'."
return args