IDEA-Research / detrex

detrex is a research platform for DETR-based object detection, segmentation, pose estimation and other visual recognition tasks.
https://detrex.readthedocs.io/en/latest/
Apache License 2.0
2.02k stars 211 forks source link

Run on CPU #105

Closed nikitabelooussovbtis closed 2 years ago

nikitabelooussovbtis commented 2 years ago

Hi, Is it possible to train the model only using a CPU? I tried changing projects/dab_detr/configs/models/dab_detr_r50.py file so that device is cpu, but it seems to still try to use GPUs.

rentainhe commented 2 years ago

Hi, Is it possible to train the model only using a CPU? I tried changing projects/dab_detr/configs/models/dab_detr_r50.py file so that device is cpu, but it seems to still try to use GPUs.

Apologies for the misunderstandings for the lack of clarifications in our documentation and config files, if you want to train model on CPU, you need to both update the train config and model config as following:

# your config file

train.device = "cpu"
model.device = train.device

We will add this to all the configs under detrex later~ @n12iB

rentainhe commented 2 years ago

We've already rebuild the config files to make them more clear in this PR: https://github.com/IDEA-Research/detrex/pull/107 @n12iB

nikitabelooussovbtis commented 2 years ago

@rentainhe thank you

rentainhe commented 2 years ago

As there is no more activity, I am closing the issue~ Feel free to reopen it if necessary. Or you can leave a new issue if you meet some other problems.