What is the purpose of serialization?

Hi everyone!!
I didn’t understand yet the purpose of the serialization process.
What reasons we have to execute a serialization process and what is the purpose to serialize a tensor or
a model in PyTorch?

Best regards,

Matheus Santos.

Serialization can be used for the following:

  • checkpointing: saving the current weights of the model in the middle of training so that if your current training process gets terminated unexpectedly you don’t have to retrain from the start
  • loading a trained model for inference: if you have trained a model, you’ll probably want to save the weights so that the model can be used in the future. torch.save and torch.load give a way to do that.

Ok I understood this and make sense, thanks! :smiley:

But what is the advantages?
Couldn’t the model be saved in another format?
I would like to understand the advantages of performing serialization, what kind of representation serialization provides that it is necessary to perform.

Is it a way to represent the data inside tensors or weights of a net?