diff --git a/mmdet/core/__init__.py b/mmdet/core/__init__.py index 81ee7311bcd5e7c534e55902ddc799a4e83225b3..20e124bd21f6c99e660a08e6821cfcdbc7dcfb5a 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 e04da6a9a5c82c02c924ecd7c763aaf8b1c02d4e..9e67c7f47c9d56aa5804716da99506254ce3ae76 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 7186ad75ccce950c13ae65e6c94dfea106e6cd03..0000000000000000000000000000000000000000 --- 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()