The trained neural network is extracted from a checkpoint and dumped into a model file. This process is called "freezing" a model. To freeze a model, typically one does
::::{tab-set}
:::{tab-item} TensorFlow {{ tensorflow_icon }}
$ dp freeze -o model.pbin the folder where the model is trained. The output model is called model.pb.
The idea and part of our code are from Morgan.
:::
:::{tab-item} PyTorch {{ pytorch_icon }}
$ dp --pt freeze -o model.pthin the folder where the model is trained. The output model is called model.pth.
In multi-task mode, you need to choose one available heads (e.g. CHOSEN_BRANCH) by --head
to specify which model branch you want to freeze:
$ dp --pt freeze -o model_branch1.pth --head CHOSEN_BRANCHThe output model is called model_branch1.pth, which is the specifically frozen model with the CHOSEN_BRANCH head.
:::
:::{tab-item} Paddle {{ paddle_icon }}
$ dp --pd freeze -o modelin the folder where the model is trained. The output model is called model.json and model.pdiparams.
In multi-task mode, you need to choose one available heads (e.g. CHOSEN_BRANCH) by --head
to specify which model branch you want to freeze:
$ dp --pd freeze -o model_branch1 --head CHOSEN_BRANCHThe output model is called model_branch1.json, which is the specifically frozen model with the CHOSEN_BRANCH head.
:::
::::