Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Version 1.x mmocr reports an error when outputting best_checkponts #1990

Open
2 tasks done
136LYJ opened this issue Sep 25, 2023 · 0 comments
Open
2 tasks done

Version 1.x mmocr reports an error when outputting best_checkponts #1990

136LYJ opened this issue Sep 25, 2023 · 0 comments

Comments

@136LYJ
Copy link

136LYJ commented Sep 25, 2023

Prerequisite

Task

I'm using the official example scripts/configs for the officially supported tasks/models/datasets.

Branch

main branch https://github.com/open-mmlab/mmocr

Environment

1.x version

Reproduces the problem - code sample

default_runtime.py

default_hooks = dict(
timer=dict(type='IterTimerHook'),
logger=dict(type='LoggerHook', interval=50),
param_scheduler=dict(type='ParamSchedulerHook'),
checkpoint=dict(type='CheckpointHook',interval=1,by_epoch=True, save_best=["word_acc","word_acc_ignore_case"], rule="greater"),
sampler_seed=dict(type='DistSamplerSeedHook'),
sync_buffer=dict(type='SyncBuffersHook'),
# show pictures, not table
visualization=dict(
type='VisualizationHook',
interval=10,
enable=False,
show=False,
draw_gt=False,
draw_pred=False),
)

Reproduces the problem - command or script

Reproduces the problem - error message

Traceback (most recent call last):
File "tools/train.py", line 114, in
main()
File "tools/train.py", line 110, in main
runner.train()
File "/home/lianyj/miniconda3/envs/open-mmlab/lib/python3.8/site-packages/mmengine/runner/runner.py", line 1745, in train
model = self.train_loop.run() # type: ignore
File "/home/lianyj/miniconda3/envs/open-mmlab/lib/python3.8/site-packages/mmengine/runner/loops.py", line 102, in run
self.runner.val_loop.run()
File "/home/lianyj/miniconda3/envs/open-mmlab/lib/python3.8/site-packages/mmengine/runner/loops.py", line 367, in run
self.runner.call_hook('after_val_epoch', metrics=metrics)
File "/home/lianyj/miniconda3/envs/open-mmlab/lib/python3.8/site-packages/mmengine/runner/runner.py", line 1807, in call_hook
getattr(hook, fn_name)(self, **kwargs)
File "/home/lianyj/miniconda3/envs/open-mmlab/lib/python3.8/site-packages/mmengine/hooks/checkpoint_hook.py", line 361, in after_val_epoch
self._save_best_checkpoint(runner, metrics)
File "/home/lianyj/miniconda3/envs/open-mmlab/lib/python3.8/site-packages/mmengine/hooks/checkpoint_hook.py", line 505, in _save_best_checkpoint
key_score = metrics[key_indicator]
KeyError: 'word_acc'

Additional information

No response

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant