raoyongming / DynamicViT

[NeurIPS 2021] [T-PAMI] DynamicViT: Efficient Vision Transformers with Dynamic Token Sparsification
https://dynamicvit.ivg-research.xyz/
MIT License
551 stars 69 forks source link

RuntimeError: Expected all tensors to be on the same device, but found at least two devices, cuda:0 and cuda:1! (when checking argument for argument index in method wrapper_scatter__value) #44

Closed King4819 closed 5 months ago

King4819 commented 6 months ago

Hi, when I change args --device to 'cuda:1', it gives me this error

RuntimeError: Expected all tensors to be on the same device, but found at least two devices, cuda:0 and cuda:1! (when checking argument for argument index in method wrapper_scatter__value)

Thanks!!!

raoyongming commented 6 months ago

Hi, in our codebase, args.device should always be cuda. If you want to specify a GPU to run the code, you could use the environment variable like CUDA_VISIBLE_DEVICES=1.

King4819 commented 6 months ago

@raoyongming Thanks for your reply !!!