deq icon indicating copy to clipboard operation
deq copied to clipboard

Expected a 'cuda' device type for generator but found 'cpu'

Open dorazhiyuyang opened this issue 2 years ago • 2 comments

I use this command

CUDA_VISIBLE_DEVICES=0,1 python tools/cls_train.py --cfg experiments/cifar/cls_mdeq_TINY.yaml

and got this error

'Expected a 'cuda' device type for generator but found 'cpu' '

dorazhiyuyang avatar Mar 13 '23 15:03 dorazhiyuyang

Hi @dorazhiyuyang ,

Thank you for your interest in DEQs! Could you please elaborate on your problems?

In addition, we will release a library and a model zoo for DEQs later (with systematically designed code and verified implementations). Hopefully, this can help solve the training issues. Before that, I'd suggest trying phantom grad's code to train your MDEQ.

Zhengyang

Gsunshine avatar Mar 19 '23 19:03 Gsunshine

I got the same error and I fixed it changing ....../torch/utils/data/sampler.py line 121: generator = torch.Generator() to generator = torch.Generator(device='cuda') (using for example vi editor). Then if you want to train a resnet model (and I guess any explicit model) you have to change it again to: generator = torch.Generator()

14jrojas avatar May 24 '23 08:05 14jrojas