Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
dorazhiyuyang opened this issue Mar 13, 2023 · 2 comments
Open

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

dorazhiyuyang opened this issue Mar 13, 2023 · 2 comments

Comments

@dorazhiyuyang
Copy link

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' '

@Gsunshine
Copy link
Member

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

@14jrojas
Copy link

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()

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants