From 5686a37548cc20fc1242a78ef6dd993312eebdfd Mon Sep 17 00:00:00 2001 From: Kai Chen <chenkaidev@gmail.com> Date: Sun, 7 Oct 2018 19:37:13 +0800 Subject: [PATCH] some renaming --- mmdet/core/__init__.py | 2 +- mmdet/core/{rpn_ops => anchor}/__init__.py | 0 mmdet/core/{rpn_ops => anchor}/anchor_generator.py | 0 mmdet/core/{rpn_ops => anchor}/anchor_target.py | 0 mmdet/core/utils/__init__.py | 3 +-- mmdet/core/utils/hooks.py | 11 ----------- 6 files changed, 2 insertions(+), 14 deletions(-) rename mmdet/core/{rpn_ops => anchor}/__init__.py (100%) rename mmdet/core/{rpn_ops => anchor}/anchor_generator.py (100%) rename mmdet/core/{rpn_ops => anchor}/anchor_target.py (100%) delete mode 100644 mmdet/core/utils/hooks.py diff --git a/mmdet/core/__init__.py b/mmdet/core/__init__.py index 81ee731..20e124b 100644 --- a/mmdet/core/__init__.py +++ b/mmdet/core/__init__.py @@ -1,4 +1,4 @@ -from .rpn_ops import * # noqa: F401, F403 +from .anchor import * # noqa: F401, F403 from .bbox_ops import * # noqa: F401, F403 from .mask_ops import * # noqa: F401, F403 from .losses import * # noqa: F401, F403 diff --git a/mmdet/core/rpn_ops/__init__.py b/mmdet/core/anchor/__init__.py similarity index 100% rename from mmdet/core/rpn_ops/__init__.py rename to mmdet/core/anchor/__init__.py diff --git a/mmdet/core/rpn_ops/anchor_generator.py b/mmdet/core/anchor/anchor_generator.py similarity index 100% rename from mmdet/core/rpn_ops/anchor_generator.py rename to mmdet/core/anchor/anchor_generator.py diff --git a/mmdet/core/rpn_ops/anchor_target.py b/mmdet/core/anchor/anchor_target.py similarity index 100% rename from mmdet/core/rpn_ops/anchor_target.py rename to mmdet/core/anchor/anchor_target.py diff --git a/mmdet/core/utils/__init__.py b/mmdet/core/utils/__init__.py index e04da6a..9e67c7f 100644 --- a/mmdet/core/utils/__init__.py +++ b/mmdet/core/utils/__init__.py @@ -1,9 +1,8 @@ from .dist_utils import (init_dist, reduce_grads, DistOptimizerHook, DistSamplerSeedHook) -from .hooks import EmptyCacheHook from .misc import tensor2imgs, unmap, multi_apply __all__ = [ 'init_dist', 'reduce_grads', 'DistOptimizerHook', 'DistSamplerSeedHook', - 'EmptyCacheHook', 'tensor2imgs', 'unmap', 'multi_apply' + 'tensor2imgs', 'unmap', 'multi_apply' ] diff --git a/mmdet/core/utils/hooks.py b/mmdet/core/utils/hooks.py deleted file mode 100644 index 7186ad7..0000000 --- a/mmdet/core/utils/hooks.py +++ /dev/null @@ -1,11 +0,0 @@ -import torch -from mmcv.runner import Hook - - -class EmptyCacheHook(Hook): - - def before_epoch(self, runner): - torch.cuda.empty_cache() - - def after_epoch(self, runner): - torch.cuda.empty_cache() -- GitLab