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

Getting errors or found a bug when converting faces from a trained model? Post about them here


Forum rules

Read the FAQs and search the forum before posting a new topic.

This forum is for reporting errors with the Convert process. If you want to get tips, or better understand the Convert process, then you should look in the Convert Discussion forum.

Please mark any answers that fixed your problems so others can find the solutions.

Locked
User avatar
Swagmuffin
Posts: 2
Joined: Fri Jun 24, 2022 3:42 am

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

Post 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.

User avatar
torzdf
Posts: 2649
Joined: Fri Jul 12, 2019 12:53 am
Answers: 159
Has thanked: 128 times
Been thanked: 623 times

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

Post by torzdf »

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

My word is final

User avatar
Swagmuffin
Posts: 2
Joined: Fri Jun 24, 2022 3:42 am

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

Post 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.

Locked