Skip to content

Commit

Permalink
Merge a9ec30e into a7f8e96
Browse files Browse the repository at this point in the history
  • Loading branch information
mzr1996 authored Feb 9, 2022
2 parents a7f8e96 + a9ec30e commit c397926
Show file tree
Hide file tree
Showing 19 changed files with 29 additions and 755 deletions.
22 changes: 3 additions & 19 deletions mmcls/apis/train.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,30 +6,14 @@
import torch
import torch.distributed as dist
from mmcv.parallel import MMDataParallel, MMDistributedDataParallel
from mmcv.runner import (DistSamplerSeedHook, build_optimizer, build_runner,
get_dist_info)
from mmcv.runner import (DistSamplerSeedHook, Fp16OptimizerHook,
build_optimizer, build_runner, get_dist_info)
from mmcv.runner.hooks import DistEvalHook, EvalHook

from mmcls.core import DistOptimizerHook
from mmcls.datasets import build_dataloader, build_dataset
from mmcls.utils import get_root_logger

# TODO import eval hooks from mmcv and delete them from mmcls
try:
from mmcv.runner.hooks import EvalHook, DistEvalHook
except ImportError:
warnings.warn('DeprecationWarning: EvalHook and DistEvalHook from mmcls '
'will be deprecated.'
'Please install mmcv through master branch.')
from mmcls.core import EvalHook, DistEvalHook

# TODO import optimizer hook from mmcv and delete them from mmcls
try:
from mmcv.runner import Fp16OptimizerHook
except ImportError:
warnings.warn('DeprecationWarning: FP16OptimizerHook from mmcls will be '
'deprecated. Please install mmcv>=1.1.4.')
from mmcls.core import Fp16OptimizerHook


def init_random_seed(seed=None, device='cuda'):
"""Initialize random seed.
Expand Down
1 change: 0 additions & 1 deletion mmcls/core/__init__.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
# Copyright (c) OpenMMLab. All rights reserved.
from .evaluation import * # noqa: F401, F403
from .fp16 import * # noqa: F401, F403
from .hook import * # noqa: F401, F403
from .optimizers import * # noqa: F401, F403
from .utils import * # noqa: F401, F403
6 changes: 2 additions & 4 deletions mmcls/core/evaluation/__init__.py
Original file line number Diff line number Diff line change
@@ -1,12 +1,10 @@
# Copyright (c) OpenMMLab. All rights reserved.
from .eval_hooks import DistEvalHook, EvalHook
from .eval_metrics import (calculate_confusion_matrix, f1_score, precision,
precision_recall_f1, recall, support)
from .mean_ap import average_precision, mAP
from .multilabel_eval_metrics import average_performance

__all__ = [
'DistEvalHook', 'EvalHook', 'precision', 'recall', 'f1_score', 'support',
'average_precision', 'mAP', 'average_performance',
'calculate_confusion_matrix', 'precision_recall_f1'
'precision', 'recall', 'f1_score', 'support', 'average_precision', 'mAP',
'average_performance', 'calculate_confusion_matrix', 'precision_recall_f1'
]
107 changes: 0 additions & 107 deletions mmcls/core/evaluation/eval_hooks.py

This file was deleted.

5 changes: 0 additions & 5 deletions mmcls/core/fp16/__init__.py

This file was deleted.

161 changes: 0 additions & 161 deletions mmcls/core/fp16/decorators.py

This file was deleted.

Loading

0 comments on commit c397926

Please sign in to comment.