mirror of
https://github.com/saymrwulf/onnxruntime.git
synced 2026-07-04 04:07:22 +00:00
Fix the TypeError issue in quantize.py (#19459)
### Description <!-- Describe your changes. --> <!-- - Why is this change required? What problem does it solve? - If it fixes an open issue, please link to the issue here. --> Fix related bug as described in https://github.com/microsoft/onnxruntime/issues/19430
This commit is contained in:
parent
5bb58a10e7
commit
9e19684944
1 changed files with 1 additions and 1 deletions
|
|
@ -479,7 +479,7 @@ def quantize_static(
|
|||
del dataloader
|
||||
model = sq.transform(extra_options.get("SmoothQuantAlpha", 0.5), extra_options.get("SmoothQuantFolding", True))
|
||||
sq_path = tempfile.TemporaryDirectory(prefix="ort.quant.")
|
||||
model_input = Path(sq_path).joinpath("sq_model.onnx").as_posix()
|
||||
model_input = Path(sq_path.name).joinpath("sq_model.onnx").as_posix()
|
||||
model.save(model_input)
|
||||
nodes_to_exclude.extend([i.name for i in model.model.graph.node if i.name not in orig_nodes])
|
||||
model = load_model_with_shape_infer(Path(model_input)) # use smooth quant model for calibration
|
||||
|
|
|
|||
Loading…
Reference in a new issue