Skip to content

Commit

Permalink
set by_epoch=False
Browse files Browse the repository at this point in the history
  • Loading branch information
xvjiarui committed Apr 27, 2021
1 parent e690281 commit b8eeaa5
Showing 1 changed file with 10 additions and 4 deletions.
14 changes: 10 additions & 4 deletions mmseg/core/evaluation/eval_hooks.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,9 @@ class EvalHook(BasicEvalHook):
"""Single GPU EvalHook, with efficient test support.
Args:
by_epoch (bool): Determine perform evaluation by epoch or by iteration.
If set to True, it will perform by epoch. Otherwise, by iteration.
Default: False.
efficient_test (bool): Whether save the results as local numpy files to
save CPU memory during evaluation. Default: False.
Returns:
Expand All @@ -16,8 +19,8 @@ class EvalHook(BasicEvalHook):

greater_keys = ['mIoU', 'mAcc', 'aAcc']

def __init__(self, *args, efficient_test=False, **kwargs):
super().__init__(*args, **kwargs)
def __init__(self, *args, by_epoch=False, efficient_test=False, **kwargs):
super().__init__(*args, by_epoch=by_epoch, **kwargs)
self.efficient_test = efficient_test

def after_train_iter(self, runner):
Expand All @@ -43,6 +46,9 @@ class DistEvalHook(BasicDistEvalHook):
"""Distributed EvalHook, with efficient test support.
Args:
by_epoch (bool): Determine perform evaluation by epoch or by iteration.
If set to True, it will perform by epoch. Otherwise, by iteration.
Default: False.
efficient_test (bool): Whether save the results as local numpy files to
save CPU memory during evaluation. Default: False.
Returns:
Expand All @@ -51,8 +57,8 @@ class DistEvalHook(BasicDistEvalHook):

greater_keys = ['mIoU', 'mAcc', 'aAcc']

def __init__(self, *args, efficient_test=False, **kwargs):
super().__init__(*args, **kwargs)
def __init__(self, *args, by_epoch=False, efficient_test=False, **kwargs):
super().__init__(*args, by_epoch=by_epoch, **kwargs)
self.efficient_test = efficient_test

def after_train_iter(self, runner):
Expand Down

0 comments on commit b8eeaa5

Please sign in to comment.