# Memory problems

**URL:** <https://discuss.pytorch.org/t/memory-problems/137401>\
**Category:** vision\
**Created:** [November 21, 2021, 1:10am UTC](https://discuss.pytorch.org/t/memory-problems/137401 "2021-11-21T01:10:17Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![gokijam](https://discuss.pytorch.org/letter_avatar_proxy/v4/letter/g/bbce88/32.png) [@gokijam](https://discuss.pytorch.org/u/gokijam)\
**Post date:** [November 21, 2021, 1:10am UTC](https://discuss.pytorch.org/t/memory-problems/137401/1 "2021-11-21T01:10:17Z")

</div>

First Problem:

> RuntimeError: expected scalar type Float but found Double

I tried to fixed this by adding this:

> i = i.float()  
> recon = model(i) #Training model

After this changing, I received:

> not enough memory: you tried to allocate 10616832000 bytes.

It is about 10GB, I worked on CPU because my GPU is GTX 970 but i have 32GB of RAM and always have a amount of free 25 GB.

I received suggestion to force this to work on double (float64), is a any chance for that?  
My input data is numpy array with matrices 480x480 (MRI data)

CPU: Intel(R) Core™ i7-6700K CPU @ 4.00GHz 4.01 GHz  
RAM: 32,0 GB  
GPU: GeForce GTX 970

This is university course project, so I don’t want to spend money for cloud GPU.

---

<div class="post-metadata">

**Author:** ![ptrblck](https://discuss.pytorch.org/user_avatar/discuss.pytorch.org/ptrblck/32/1823_2.png) [@ptrblck](https://discuss.pytorch.org/u/ptrblck)\
**Post date:** [November 21, 2021, 7:39am UTC](https://discuss.pytorch.org/t/memory-problems/137401/2 "2021-11-21T07:39:48Z")

</div>

Based on the error message I don’t think you are running out of memory on your GPU but on your host, so you might want to double check the memory requirements of your script for host RAM.
