Skip to content

Commit 10fe66c

Browse files
committed
Fix 'tuple' object has no attribute 'to_dict' for bert
1 parent afba506 commit 10fe66c

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

quantization/nlp/bert/migraphx/e2e_migraphx_bert_example.py

+6-1
Original file line numberDiff line numberDiff line change
@@ -554,7 +554,12 @@ def output_run_config(flags, samples):
554554
json_compute_range[k] = (float(v.range_value[0]), float(v.range_value[1]))
555555

556556

557-
write_calibration_table(json_compute_range)
557+
print("Writing calibration table")
558+
try:
559+
write_calibration_table(json_compute_range)
560+
except AttributeError as e:
561+
# Handle `AttributeError: 'tuple' object has no attribute 'to_dict'`.
562+
write_calibration_table(compute_range.data)
558563
print("Calibration is done. Calibration cache is saved to calibration.json")
559564

560565
model_quants = model_quants + "_int8"

0 commit comments

Comments
 (0)