# Restarting training from a checkpoint

**URL:** </static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Ft%2Frestarting-training-from-a-checkpoint%2F22367%3E%5C
**Category:** 🧨 Diffusers\
**Created:** [August 31, 2022, 9:02pm UTC](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Ft%2Frestarting-training-from-a-checkpoint%2F22367 "2022-08-31T21:02:26Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![madams](https://sea2.discourse-cdn.com/hellohellohello/user_avatar/discuss.huggingface.co/madams/32/5838_2.png) [@madams](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Fu%2Fmadams)%5C
**Post date:** [August 31, 2022, 9:02pm UTC](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Ft%2Frestarting-training-from-a-checkpoint%2F22367%2F1 "2022-08-31T21:02:26Z")

</div>

I’m following through the [Training a diffusers model](https://colab.research.google.com/github/huggingface/notebooks/blob/main/diffusers/training_example.ipynb) notebook and I’ve adapted it and run 50 epochs on my own dataset. I’m running on Colab so I need to do training in small-ish bursts, so I’d like to set the notebook up to start training from the last checkpoint.

Reading through the code I saw how to load a pretrained model and that it needs to be set from eval mode back to train, which I’ve done with:

```python
model = UNet2DModel.from_pretrained(previous_checkpoint_dir + '/unet')
model.train()

```

I then ran the rest of the notebook code as-is (apart of some code to find the last checkpoint) to restart the training. Is there any more to it than that?
