diff --git a/doc/source/how-to-save-and-load-model-checkpoints.rst b/doc/source/how-to-save-and-load-model-checkpoints.rst index 404df485fbae..0d711e375cd8 100644 --- a/doc/source/how-to-save-and-load-model-checkpoints.rst +++ b/doc/source/how-to-save-and-load-model-checkpoints.rst @@ -91,3 +91,7 @@ To load your progress, you simply append the following lines to your code. Note print("Loading pre-trained model from: ", latest_round_file) state_dict = torch.load(latest_round_file) net.load_state_dict(state_dict) + state_dict_ndarrays = [v.cpu().numpy() for v in net.state_dict().values()] + parameters = fl.common.ndarrays_to_parameters(state_dict_ndarrays) + +Return/use this object of type ``Parameters`` wherever necessary, such as in the ``initial_parameters`` when defining a ``Strategy``. \ No newline at end of file