facemask icon indicating copy to clipboard operation
facemask copied to clipboard

Could not load the model. Showing CUDA error

Open anujit-mandal opened this issue 4 years ago • 3 comments

image While I try to load the model it is showing "in _check_driver raise AssertionError("Torch not compiled with CUDA enabled") AssertionError: Torch not compiled with CUDA enabled". Torch installation is not done with cuda enabled.

anujit-mandal avatar May 05 '20 08:05 anujit-mandal

You have a problem because your torch was not compiled with CUDA capabilities... be sure you have a GPU card and use a version of torch with cuda capabilities

juancaceres avatar May 08 '20 21:05 juancaceres

facemask/utils/config.py line 6: config.device = torch.device('cpu')

swuxyj avatar Jun 02 '20 14:06 swuxyj

To add to @swuxyj 's response and to avoid having to install it manually:

import torch
import facemask as fm
fm.utils.config.config.device = torch.device('cpu')

# Or this: model = fm.FaceMaskDetector(modelpath, device=torch.device('cpu'))
model = fm.FaceMaskDetector(modelpath)
...

joao-carvalheira avatar Jul 03 '20 09:07 joao-carvalheira