--evaluator

Description

Sets the Python script that is based on the Evaluator base class and contains the evaluator.

Include this option if you fail to obtain the .bin dataset that matches your model or you want to use your own script for PTQ.

See Also

This option is mutually exclusive with --input_shape, --data_dir, and --data_types.

Argument

Argument: Python script that contains the evaluator.

Restrictions: none.

Suggestions and Benefits

None

Example

--evaluator=EVALUATOR.py

The following is a script example. Define the calibration() callback function, which calibrates the model by running forward passes, based on the original model and test dataset.

1
2
3
4
5
class ModelEvaluator(AutoCalibrationEvaluatorBase):
     # The evaluator for model

    def calibration(self, model_file, weights_file):
        # Calibrate the model by running batch_num forward passes.

Restrictions

This option applies only to PTQ.