Skip to content

Commit

Permalink
[Fix] fix rknn quantization pipeline (#1636)
Browse files Browse the repository at this point in the history
* fix rknn quantization pipeline

* resolve comments
  • Loading branch information
AllentDan authored Jan 31, 2023
1 parent a19cf64 commit 5ab0bcb
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 7 deletions.
7 changes: 1 addition & 6 deletions mmdeploy/backend/rknn/backend_manager.py
Original file line number Diff line number Diff line change
Expand Up @@ -50,14 +50,9 @@ def is_available(cls, with_custom_ops: bool = False) -> bool:
"""
import importlib
try:
ret = importlib.util.find_spec('rknn-toolkit2') is not None
ret = importlib.util.find_spec('rknn') is not None
except Exception:
pass
if ret is None:
try:
ret = importlib.util.find_spec('rknn-toolkit') is not None
except Exception:
pass
return ret

@classmethod
Expand Down
3 changes: 2 additions & 1 deletion tools/deploy.py
Original file line number Diff line number Diff line change
Expand Up @@ -218,7 +218,8 @@ def main():
dataset_file = tempfile.NamedTemporaryFile(suffix='.txt').name
with open(dataset_file, 'w') as f:
f.writelines([osp.abspath(args.img)])
quantization_cfg.setdefault('dataset', dataset_file)
if quantization_cfg.get('dataset', None) is None:
quantization_cfg['dataset'] = dataset_file
if backend == Backend.ASCEND:
# TODO: Add this to backend manager in the future
if args.dump_info:
Expand Down

0 comments on commit 5ab0bcb

Please sign in to comment.