Add more details for quantization failure error message
PiperOrigin-RevId: 305727582 Change-Id: I360dd94e03ae867972db502879d043c7e801ac60
This commit is contained in:
parent
15d75b1ad1
commit
a6e10b6e09
@ -1001,9 +1001,20 @@ TfLiteStatus FillQuantizationParams(
|
||||
// Dynamic tensor.
|
||||
} else if (!utils::HasMinMax(tensor) &&
|
||||
!utils::HasBuffer(model, subgraph, tensor_idx)) {
|
||||
TF_LITE_REPORT_ERROR(error_reporter,
|
||||
"Max and min for dynamic tensors should be"
|
||||
" recorded during calibration");
|
||||
TF_LITE_REPORT_ERROR(
|
||||
error_reporter,
|
||||
"Max and min for dynamic tensors should be"
|
||||
" recorded during calibration: Failed for tensor %s\n",
|
||||
tensor->name.c_str());
|
||||
if (tensor->quantization == nullptr) {
|
||||
TF_LITE_REPORT_ERROR(error_reporter,
|
||||
"No quantization params for tensor %s",
|
||||
tensor->name.c_str());
|
||||
} else if (tensor->quantization->min.empty() ||
|
||||
tensor->quantization->max.empty()) {
|
||||
TF_LITE_REPORT_ERROR(error_reporter, "Empty min/max for tensor %s",
|
||||
tensor->name.c_str());
|
||||
}
|
||||
return kTfLiteError;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user