PaddlePaddle supports exporting inference model for deployment. Compared with training, inference model files store network weights and network structures persistently, and PaddlePaddle supports more fast prediction engine loading inference model to deployment.
First, refer to the [Installing PaddlePaddle](../installation/install_paddle_en.md) and the [Installing PaddleClas](../installation/install_paddleclas_en.md) to prepare environment.
The above model weights is trained by ResNet50_vd model on ImageNet1k dataset and training configuration file is `ppcls/configs/ImageNet/ResNet/ResNet50_vd.yaml`. To export the inference model, just run the following command:
The above model weights file is trained by ResNet50_vd on AliProduct dataset, and the training configuration file is `ppcls/configs/Products/ResNet50_vd_Aliproduct.yaml`. The command to export inference model is as follow:
In the above model export command, the configuration file used must be the same as the training configuration file. The following fields in the configuration file are used to configure exporting model parameters.
*`Global.image_shape`:To specify the input data size of the model, which does not contain the batch dimension;
*`Global.save_inference_dir`:To specify directory of saving inference model files exported;
*`Global.pretrained_model`:To specify the path of model weight file saved during training. This path does not need to contain the suffix `.pdparams` of model weight file;
The exporting model command will generate the following three files:
*`inference.pdmodel`:To store model network structure information;
*`inference.pdiparams`:To store model network weight information;
*`inference.pdiparams.info`:To store the parameter information of the model, which can be ignored in the classification model and recognition model;
The inference model exported is used to deployment by using prediction engine. You can refer the following docs according to different deployment modes / platforms