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

[Fix] Substitute SyncBN with BN for mmpose #1631

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 0 additions & 23 deletions mmdeploy/codebase/mmpose/deploy/pose_detection.py
Original file line number Diff line number Diff line change
Expand Up @@ -145,31 +145,8 @@ class PoseDetection(BaseTask):
def __init__(self, model_cfg: mmengine.Config, deploy_cfg: mmengine.Config,
device: str):
super().__init__(model_cfg, deploy_cfg, device)

hanrui1sensetime marked this conversation as resolved.
Show resolved Hide resolved
def build_pytorch_model(self,
model_checkpoint: Optional[str] = None,
cfg_options: Optional[Dict] = None,
**kwargs) -> torch.nn.Module:
"""build pytorch model from model config and checkpoint
Args:
model_checkpoint (str|None): Input model checkpoint file.
cfg_options (dict|None): Optional config arguments.

Returns:
nn.Module: An initialized pytorch model.
"""
from mmpose.apis import init_model
from mmpose.utils import register_all_modules
register_all_modules()
self.model_cfg.model.test_cfg['flip_test'] = False

model = init_model(
self.model_cfg,
model_checkpoint,
device=self.device,
cfg_options=cfg_options)
return model

def build_backend_model(
self,
model_files: Sequence[str] = None,
Expand Down