Skip to content

Commit

Permalink
Fix the TypeError issue in quantize.py (microsoft#19459)
Browse files Browse the repository at this point in the history
### 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
microsoft#19430
  • Loading branch information
duanshengliu authored Feb 27, 2024
1 parent 5bb58a1 commit 9e19684
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion onnxruntime/python/tools/quantization/quantize.py
Original file line number Diff line number Diff line change
Expand Up @@ -479,7 +479,7 @@ def inc_dataloader():
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
Expand Down

0 comments on commit 9e19684

Please sign in to comment.