[Fix] Fix MobileOne deployment. (#1870)

* fix task

* fix regression;

* fix ut
pull/1884/head
hanrui1sensetime 2023-03-13 10:54:07 +08:00 committed by GitHub
parent c6cf781fa6
commit 637958a910
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 4 additions and 1 deletions

View File

@ -123,6 +123,9 @@ class BaseTask(metaclass=ABCMeta):
load_checkpoint(model, model_checkpoint, map_location=self.device) load_checkpoint(model, model_checkpoint, map_location=self.device)
model = revert_sync_batchnorm(model) model = revert_sync_batchnorm(model)
if hasattr(model, 'backbone') and hasattr(model.backbone,
'switch_to_deploy'):
model.backbone.switch_to_deploy()
model = model.to(self.device) model = model.to(self.device)
model.eval() model.eval()
return model return model

View File

@ -215,7 +215,7 @@ models:
- name: MobileOne - name: MobileOne
metafile: configs/mobileone/metafile.yml metafile: configs/mobileone/metafile.yml
model_configs: model_configs:
- configs/mobileone/deploy/mobileone-s0_deploy_8xb128_in1k.py - configs/mobileone/mobileone-s0_8xb32_in1k.py
pipelines: pipelines:
- *pipeline_trt_static_fp16 - *pipeline_trt_static_fp16
- *pipeline_ort_dynamic_fp32 - *pipeline_ort_dynamic_fp32