face-frontalization
face-frontalization copied to clipboard
Memory Error
Hi, I run demo.py for a single image. it worked well
When I run more than 300 images in a loop in windows 32bit it shows the following error
Traceback (most recent call last):
File "demo.py", line 75, in
How to avoid the memory error
Thanks in advance for your valuable help
Hi @haridatascientist
As you posted, the line that is throwing the error is:
denominator = weights + weight_take_from_org + weight_take_from_sym
This is a simple Numpy matrix addition which shouldn't be a problem. It seems that you are running out of memory to perform this operation. Are you seeing this error specifically after frontalizing more than 300 images? Are you keeping all those images in memory? I suggest you keep track of your memory usage. One thing you can do is write the image to disk after you frontalize in order to free memory space.
If you want to go further, you can check which Numpy operations are not inplace and optimize the memory usage as they mention here: http://stackoverflow.com/questions/4318615/python-numpy-memoryerror. But I don't think this would solve the problem if you're trying to keep this many images loaded in memory.
Hope it helps!
Hi @dougsouza I tried to run the code but I got an error
Hi @haridatascientist could you send me the instruction that you used to run demo().py I tried to run it but i got some errrors my email is [email protected] could you send me the code that you used and the instructions please???