Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Memory keeps increasing #12

Open
ghost opened this issue Jul 21, 2020 · 4 comments
Open

Memory keeps increasing #12

ghost opened this issue Jul 21, 2020 · 4 comments

Comments

@ghost
Copy link

ghost commented Jul 21, 2020

Hi, during the inference of each model, the memory continuously increases with each image (only for single image inference). I have tried this on CPU as well as on GPU. Is there any way to solve this?

@NikolayTV
Copy link

Give code to reproduce the error

@ghost
Copy link
Author

ghost commented Jul 22, 2020

def read_image(img_path):
    img = cv2.imread(img_path)
    img = cv2.cvtColor(img, cv2.COLOR_BGR2RGB)
    return img

detector = face_detection.build_detector("DSFDDetector", confidence_threshold=.5, nms_iou_threshold=.3)
image_paths = ['img1.jpg', 'img2.png', ...]    # list of image paths

predictions = detector.detect(read_image(str(image_paths[0])))  
predictions = detector.detect(read_image(str(image_paths[1])))  
predictions = detector.detect(read_image(str(image_paths[2])))  

My RAM keeps on increasing as I do inference for more and more images. RAM is not getting freed.

@hukkelas
Copy link
Owner

Hi, I don't have access to a GPU currently as I'm on vacation. Will be able to inspect the issue when I'm back.
If anyone finds the issue, please submit a pull request and I should be able to review it.

@NikolayTV
Copy link

I also have this issue. On GPU it works fine, CPU inference loads the memory

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants