# \[Diffusers\] PyTorch running out of memory

**URL:** </static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Ft%2Fdiffusers-pytorch-running-out-of-memory%2F22122%3E%5C
**Category:** 🧨 Diffusers\
**Created:** [August 26, 2022, 12:21am UTC](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Ft%2Fdiffusers-pytorch-running-out-of-memory%2F22122 "2022-08-26T00:21:04Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![howon92](https://sea2.discourse-cdn.com/hellohellohello/user_avatar/discuss.huggingface.co/howon92/32/5802_2.png) [@howon92](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Fu%2Fhowon92)%5C
**Post date:** [August 26, 2022, 12:21am UTC](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Ft%2Fdiffusers-pytorch-running-out-of-memory%2F22122%2F1 "2022-08-26T00:21:04Z")

</div>

Hi everyone, when I run this diffuser [notebook](https://colab.research.google.com/github/patil-suraj/Notebooks/blob/master/image_2_image_using_diffusers.ipynb) on Colab, it works fine. But when I try to run it on Google Compute Engine with GPU, I get the following error:

```auto
PyTorch running out of memory: DefaultCPUAllocator can't allocate memory

```

Does anyone know how I can get around it?

---

<div class="post-metadata">

**Author:** ![anton-l](https://sea2.discourse-cdn.com/hellohellohello/user_avatar/discuss.huggingface.co/anton-l/32/2771_2.png) [@anton-l](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Fu%2Fanton-l)%5C
**Post date:** [August 30, 2022, 9:08am UTC](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Ft%2Fdiffusers-pytorch-running-out-of-memory%2F22122%2F2 "2022-08-30T09:08:57Z")

</div>

Hi @howon92! The `float16` models should fit into less than 7GB of GPU memory, so it might be that either Colab gives you a smaller GPU (could you check by running `!nvidia-smi`?) or pytorch doesn’t clear the memory between runs. Does your colab run out of memory even after resetting the runtime? Have you changed anything in the code, e.g. increased the number of inputs?
