After building and training the neural network model, you can save the model and corresponding parameters for subsequent calls.
PyTorch provides two sets of reading and writing methods. Method 1: save both the model structure and parameters, and method 2: save only the parameters.
The timing of saving the model is also a point that can be considered.
2. Save model structure and parameters at the same time
Take the vgg16 model provided by torchvision as an example.