How to use the stop/resume training method within a custom training loop #1607
-
Hello, is there a way to stop/resume training, as shown in the tutorial (i.e., loading the pickled density estimator from disc and continuing training using the resume_training=True in .train() ) but instead within a custom training loop like the one shown below? density_estimator = build_nsf(dummy_theta,dummy_x,embedding_net=embedding_net) num_epochs = 300 If I pickle the density estimator, then reload it later from disc, how do I tell it to continue training (from where it left off) within the custom training loop? Any help is much appreciated, thanks. |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments
-
Hey! With the custom training loop, everything is pytorch, so you can simply pickle (and then load) also the optimizer, and do not re-initialize the network. Michael |
Beta Was this translation helpful? Give feedback.
-
thank you! |
Beta Was this translation helpful? Give feedback.
Hey! With the custom training loop, everything is pytorch, so you can simply pickle (and then load) also the optimizer, and do not re-initialize the network.
Michael