RangiLyu / nanodet

NanoDet-Plusāš”Super fast and lightweight anchor-free object detection model. šŸ”„Only 980 KB(int8) / 1.8MB (fp16) and run 97FPS on cellphonešŸ”„
Apache License 2.0
5.78k stars 1.04k forks source link

How do I use the CPU for training? #518

Open lvsejunzhuang opened 1 year ago

lvsejunzhuang commented 1 year ago

Because my desktop computer does not have a GPU, I would like to try using a CPU for training

mahdizynali commented 1 year ago

i did not test it before but in "tools/test.py" there are some lines in order to check if gpu is available or not : if cfg.device.gpu_ids == -1: logger.info("Using CPU training") accelerator, devices = "cpu", None

and in the train.py it would check that argument :

if cfg.device.gpu_ids == -1: logger.info("Using CPU training") accelerator, devices, strategy, precision = ( "cpu", None, None, cfg.device.precision, )

so guess it will automatically switch on cpu mode if there is no any gpu however it's not recommended .

ForeverPs commented 1 year ago

set gpu_ids: "-1" in config file.