Introduction
Model Training, Conversion, and Evaluation
- Model training: A given training dataset is divided into the training part and the test part. The training part is used to train the model hyperparameters to obtain the CKPT file. Then, the test part is used to evaluate the accuracy and save the CKPT file with the best accuracy.
- Model conversion: MindSpore is used to convert the CKPT file with the best accuracy into an AIR file, and then the ATC tool is used to convert the AIR file into an OM model for inference on an Ascend 310 AI Processor.
- Model evaluation: Based on the given test dataset, the CKPT file with the best accuracy generated during the training is used to evaluate the accuracy, and save the data such as images generated during the evaluation.
Preparing the Configuration File
Before running wafer-related scripts, prepare two config.json files and place them in the wafer_mindspore/reference and wafer_mindspore/inspection directories, respectively. (The file name must be config.json.)
- Example of config.json in wafer_mindspore/reference
The range_lut field is mandatory. Each key value of the string type in the dictionary indicates the processor ID and layer ID. The value specifies the configuration parameter of the corresponding processor layer. For details about the parameter description, see Table 1.
{ "range_lut": { "001M1": [[15, 75], [35, 95], 0.4, 12312.123, 2243.23, 2342, 3453, 0, 0, 123] } }Table 1 Description of range_lut Parameters in reg_range_lut
Type
Value Range
Description
0
list
Two integer values within [0,100000]
Value range on the X-axis.
1
list
Two integer values within [0,100000]
Value range on the Y-axis.
2
float
[0, 1]
Threshold.
3
float
(0, 100000)
Width of a die.
4
float
(0, 100000)
Height of a die.
5
float
(0, 100000)
Grayscale image width.
6
float
(0, 100000)
Grayscale image height.
7
int
[-1000, 1000]
Offset in X-axis.
8
int
[-1000, 1000]
Offset in Y-axis.
9
int
[50, 2048]
Small image size.
- Example of config.json in wafer_mindspore/inspection
- range_lut, soie_zone, and stations are mandatory. range_lut and soie_zone indicate the key value of the string type in the dictionary, specifying the processor ID and layer ID. The value of the list type indicates the configuration parameter on the corresponding processor layer. For details about the range_lut parameter, see Table 2.
- Each key value in soie_zone is of the list type, and each element in the list indicates two pairs of X and Y coordinates with four values ranging from 0 to 100000.
- Each key in stations indicates a device name (type: str), and the corresponding value (type: int; value: 0 or 1) indicates the index values of the X and Y axes in the first and second lists of range_lut.
{ "range_lut": { "001M1": [[[15, 75], [35, 95]], [[60, 120], [20, 80]], 0.4, 12312.123, 2243.23, 2342, 3453, 1] }, "soie_zone": { "001M1": [[[15, 75], [35, 95]], [[345, 735], [435, 995]]] }, "stations": { "device_a": 0, "device_b": 1 } }Table 2 Description of range_lut Parameters in reg_range_lut
Type
Value Range
Description
0
list
Two lists whose length is 2. The type of each element is int, ranging from 0 to 100000.
X-axis range of the two devices.
1
list
Two lists whose length is 2. The type of each element is int, ranging from 0 to 100000.
Y-axis range of the two devices.
2
float
[0, 1]
Threshold.
3
float
(0, 100000)
Width of a die.
4
float
(0, 100000)
Height of a die.
5
float
(0, 100000)
Grayscale image width.
6
float
(0, 100000)
Grayscale image height.
7
float
[0.1, 10]
Magnification ratio.

