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 passing wrong backend type for patch_model #719

Merged
merged 1 commit into from
Jul 7, 2022
Merged
Show file tree
Hide file tree
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
2 changes: 1 addition & 1 deletion mmdeploy/apis/calibration.py
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ def create_calib_input_data(calib_file: str,
dataset = task_processor.build_dataset(dataset_cfg, dataset_type)

# patch model
backend = get_backend(deploy_cfg)
backend = get_backend(deploy_cfg).value
ir = IR.get(get_ir_config(deploy_cfg)['type'])
patched_model = patch_model(
model, cfg=deploy_cfg, backend=backend, ir=ir)
Expand Down
6 changes: 5 additions & 1 deletion mmdeploy/core/rewriters/rewriter_manager.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,11 @@ def patch_model(model: nn.Module,

Examples:
>>> from mmdeploy.core import patch_model
>>> patched_model = patch_model(model, cfg=deploy_cfg, backend=backend)
>>> from mmdeploy.utils import Backend, IR
>>> deploy_cfg = {}
>>> backend = Backend.DEFAULT.value
>>> ir = IR.ONNX
>>> patched_model = patch_model(model, deploy_cfg, backend, ir)
"""
return MODULE_REWRITER.patch_model(model, cfg, backend, ir, recursive,
**kwargs)
Expand Down