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] fix rknn quantization pipeline #1636

Merged
merged 2 commits into from
Jan 31, 2023
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
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