Page 1 of 1

numpy.core._exceptions._ArrayMemoryError: Unable to allocate 31.6 MiB for an array with shape (1080, 1920, 4) and data t

Posted: Fri Jun 24, 2022 3:52 am
by Swagmuffin

Hey, I've had this problem more than once and I'm not really sure what I changed the first time I had it. I keep on getting this error and it crashes only converting a small amount of the video and the converted version stops when it crashed.

Code: Select all

File "D:\Face Swap\faceswap\lib\convert.py", line 154, in process
image = self._patch_image(item)
Traceback (most recent call last):
File "D:\Face Swap\faceswap\lib\convert.py", line 191, in _patch_image
new_image, background = self._get_new_image(predicted, frame_size)
File "D:\Face Swap\faceswap\lib\convert.py", line 226, in _get_new_image
placeholder = np.zeros((frame_size[1], frame_size[0], 4), dtype="float32")
numpy.core._exceptions._ArrayMemoryError: Unable to allocate 31.6 MiB for an array with shape (1080, 1920, 4) and data type float32
File "D:\Face Swap\faceswap\lib\convert.py", line 154, in process
image = self._patch_image(item)
File "D:\Face Swap\faceswap\lib\convert.py", line 191, in _patch_image
new_image, background = self._get_new_image(predicted, frame_size)
File "D:\Face Swap\faceswap\lib\convert.py", line 226, in _get_new_image
placeholder = np.zeros((frame_size[1], frame_size[0], 4), dtype="float32")
numpy.core._exceptions._ArrayMemoryError: Unable to allocate 31.6 MiB for an array with shape (1080, 1920, 4) and data type float32

I get like 30 of these then the convert fails and stops. I dont know what to do to fix the problem, if anyone can help me out I would be very grateful. Let me know if I can give you anything that can help too.


Re: numpy.core._exceptions._ArrayMemoryError: Unable to allocate 31.6 MiB for an array with shape (1080, 1920, 4) and da

Posted: Fri Jun 24, 2022 9:25 am
by torzdf

You're basically running out of system memory. Try reducing the number of jobs running (near the bottom of the convert tab)


Re: numpy.core._exceptions._ArrayMemoryError: Unable to allocate 31.6 MiB for an array with shape (1080, 1920, 4) and da

Posted: Fri Jun 24, 2022 4:22 pm
by Swagmuffin

Okay thanks ill try that, I just assumed that my 2070 would be a lil better than it is I guess lol thanks for your help Ill let you know if it works.