Why Do I See "[IFMR]: Do layer xxx data calibration failed!" During Calibration?
Symptom
When the PyTorch framework is used to perform intermediate calibration model inference, the scale computed by the quantization algorithm is improper due to the invalid input data range. As a result, the calibration fails and the Caffe calibration process is terminated.
Possible Causes
The original data is not in the range
. (EPSILON includes DBL_EPSILON double type and FLT_EPSILON float type. Currently, the FLT_EPSILON type is used.)
The AMCT quantization supports the maximum value
obtained through calculation, because Ascend AI Processor quantization uses multiplication calculation:
. If scale is greater than
, then
is less than FLT_EPSILON. In this case, the quantization result is unreliable. Therefore, the AMCT quantization algorithm supports original activation quantization only within the range
. Otherwise, an error message is displayed, indicating that the range is not supported.

Solution
Skip the quantization layers listed in the log, for example, the conv_1 layer in the preceding log example.