Skip to content

Commit

Permalink
fix: can't show bug with weight of pth format
Browse files Browse the repository at this point in the history
  • Loading branch information
mjq2020 authored and LynnL4 committed Aug 21, 2023
1 parent af7b358 commit 7e238b9
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions tools/inference.py
Original file line number Diff line number Diff line change
Expand Up @@ -231,7 +231,10 @@ def build_config(args):

if args.show or (args.out_dir is not None):
assert 'visualization' in cfg.default_hooks, "VisualizationHook is required in 'default_hooks'"
cfg.default_hooks.visualization.draw = True
if args.task == 'mmcls':
cfg.default_hooks.visualization.enable = True
else:
cfg.default_hooks.visualization.draw = True
cfg.default_hooks.visualization.interval = args.interval
if args.show:
cfg.default_hooks.visualization.show = True
Expand All @@ -240,7 +243,7 @@ def build_config(args):
cfg.default_hooks.visualization.out_dir = args.out_dir

if args.dump is None:
args.dump = args.checkpoint.replace(os.path.splitext(args.checkpoint)[-1], '.json')
args.dump = args.checkpoint.replace(os.path.splitext(args.checkpoint)[-1], '.pkl')
print('Using dump path from checkpoint: {}'.format(args.dump))

if args.dump is not None:
Expand Down

0 comments on commit 7e238b9

Please sign in to comment.