SGNify icon indicating copy to clipboard operation
SGNify copied to clipboard

Spectre uses more than 24Gb or else a memory leak is seen, asking to create an array in the size of either hundres of peta bytes or exabytes?

Open AIMads opened this issue 2 years ago • 2 comments

Error log:

home/humaid/Desktop/SGNify/spectre/external/face_detection/ibug/face_detection/retina_face/weights/Resnet50_Final.pth 0%| | 0/27 [00:00<?, ?it/s]/home/humaid/Desktop/SGNify/spectre/external/face_detection/ibug/face_detection/retina_face/py_cpu_nms.py:19: RuntimeWarning: overflow encountered in multiply areas = (x2 - x1 + 1) * (y2 - y1 + 1) 0%| | 0/27 [00:00<?, ?it/s] Traceback (most recent call last): File "/home/humaid/Desktop/SGNify/utils/spectre_demo.py", line 228, in main(parser.parse_args()) File "/home/humaid/Desktop/SGNify/utils/spectre_demo.py", line 83, in main landmarks = extract_frames(image_paths) File "/home/humaid/Desktop/SGNify/utils/spectre_demo.py", line 39, in extract_frames landmarks, scores = face_tracker.landmark_detector(image, detected_faces, rgb=False) File "/home/humaid/mambaforge/envs/sgnify/lib/python3.10/site-packages/torch/utils/_contextlib.py", line 115, in decorate_context return func(*args, **kwargs) File "/home/humaid/Desktop/SGNify/spectre/external/face_alignment/ibug/face_alignment/fan/fan_predictor.py", line 91, in call image = np.pad(image, pad_widths) File "/home/humaid/mambaforge/envs/sgnify/lib/python3.10/site-packages/numpy/lib/arraypad.py", line 798, in pad padded, original_area_slice = _pad_simple(array, pad_width) File "/home/humaid/mambaforge/envs/sgnify/lib/python3.10/site-packages/numpy/lib/arraypad.py", line 114, in _pad_simple padded = np.empty(new_shape, dtype=array.dtype, order=order) numpy.core._exceptions._ArrayMemoryError: Unable to allocate 3.24 PiB for an array with shape (34881130, 34881130, 3) and data type uint8

AIMads avatar Jun 20 '23 14:06 AIMads

The issue seems to be something with detecting faces, the output from the face_tracker.face_detector outputs over 600 detected_faces?

AIMads avatar Jun 20 '23 15:06 AIMads

The issue can be fixed, with changing the detector from resnet50 to mobilenet, but I don't see it as a good solution.

Finally the run_sgnify function does not work either or is very unstable, it will randomly just break and return a runtime error, with no explenation

AIMads avatar Jun 20 '23 20:06 AIMads

We used SPECTRE as it is. For what concerns SGNify, we improved the code and uploaded the new version

MPForte avatar Nov 01 '24 17:11 MPForte