danielgatis / darknetpy

darknetpy is a simple binding for darknet's yolo detector.
MIT License
66 stars 15 forks source link

Memory leak issue #31

Open derneuere opened 3 years ago

derneuere commented 3 years ago

Hey, I really like this wrapper, but I have a memory leak issue. I want to integrate yolo-9000 in LibrePhotos. I added the wip branch as a pull request here. If I start multiple detector.detect function calls it will consume more and more ram and will not release the RAM after it is done.

Implementation: https://github.com/LibrePhotos/librephotos/blob/2039377a15774e3e12791a2a002bde6888cf7a38/api/yolo/object_detection.py#L1-L7

derneuere commented 3 years ago

I could improve the situation by calling gc.collect(). This is not ideal, but it helps