deepinsight / insightface

State-of-the-art 2D and 3D Face Analysis Project
https://insightface.ai
21.92k stars 5.26k forks source link

How can I force Retinaface to use CPU not cuda #2599

Closed FurkanGozukara closed 1 week ago

FurkanGozukara commented 1 week ago

I am getting cuda out of memory error very weirdly on Kaggle with 15 GB GPU

obviously there is a bug

meanwhile how can I force it to use CPU?

this is my usage

faces = RetinaFace.detect_faces(image_path)

FurkanGozukara commented 1 week ago

found the solution :D

    with tf.device('/CPU:0'):
        faces = RetinaFace.detect_faces(image_path)