Skip to content

Commit

Permalink
fix passing wrong backend type (#719)
Browse files Browse the repository at this point in the history
  • Loading branch information
RunningLeon authored Jul 7, 2022
1 parent 585e34b commit 22733c2
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
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

0 comments on commit 22733c2

Please sign in to comment.