Model Conversion

Q: Can I use the IPU_SDK convert tool to convert INT8 models directly?

A: Currently, direct input of quantized fixed-point network model of the IPU SDK is not supported. The model must be converted from floating point. You can use the quantization import tool to import existing quantization information into the model. See Rule for Importing the Quantization Parameter for details.

Q: Why does TensorFlow report an error when I use ConvertTool.py to convert a Keras model?

A: This is because TensorFlow1.14.0 is used by default, and the TensorFlow interface is called too by ConvertTool.py to convert the Keras model into TFLite. Since TensorFlow1.x does not support conversion of Keras models with TensorFlow2.0 or higher, an error will occur. Please use the TensorFlow training version to convert Keras model into TFLite first, and then use ConvertTool.py to convert.

Q: Why is the accuracy so poor when I use simulator.py to test mAP on the YOLO network?

A: Although the COCO data set has 80 classes, the label index is not continuous. If we take the empty indexes inserted in between into account, there are actually a total of 90 classes. In the official YOLO network pre-training model provided, labels with blank items have been removed, leaving the 80 classes continuous. As such, if you call the COCO interface directly to calculate mAP, the result will be incorrect.

Q: Why does the error, SGS_DMA_CoefMartixGen: Assertion s32coef_bgr < HW_COEF_MAX failed, appear when converting fixed-point models?

A: This error message indicates that the configured Python pre-processing is inconsistent with the input_config.ini, which is mainly due to the inconsistency between the configured mean and std values. For details, please refer to Image Pre-Processing Method and input config Configuration. To fix the error, check the statistical input range and compare it with the data set in the input_config.ini. When using quantized import, it should also be noted that the range set for the first layer of convolution input should be consistent with the range set in the input_config.ini.

Q: Why floating point numbers are output during PC simulation when the dequantizations in input_config.ini is set to FALSE?

A: The dequantizations configuration in input_config.ini only takes effect when the board is running. The output results of the model are all int16, as a consequence of the process done by simulator.py of multiplying the output result of int16 by the scale. You can use calibrator_custom.fixed_simulator to create an instance of a fixed-point model, and view the data type of the network output through get_output_details.

Q: Why is the progress bar stuck at "Start to analyze model..." when I convert a floating-point model to a fixed-point model?

A: In this case, check if the filename of the dataset used for quantization contains any Chinese characters.

Q: Why is all-layer comparison result not displayed in the output log when I use the DumpDebug tool to compare the loss of accuracy between a fixed-point model and a floating-point model?

A: This is because the parameter disableDomainFuseOps in DebugConfig.txt is not enabled, causing some operations to fuse. Please copy DebugConfig.txt to the execution directory, enable disableDomainFuseOps, and re-convert the model. After the model is re-converted, use a simulator to generate the sigma_outtensor_dump.bin file.

Q: Why does the message "Write file fail..." appear when I use DumpDebug to compare models?

This is because the "path = configured path" does not exist in DebugConfig.txt. Please check the configured path and enter an existing absolute path. The default path is the user's root directory.