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

torch.cuda.set_device(self.gpus[0]) #23

Open
ashergaga opened this issue Jun 4, 2019 · 3 comments
Open

torch.cuda.set_device(self.gpus[0]) #23

ashergaga opened this issue Jun 4, 2019 · 3 comments

Comments

@ashergaga
Copy link

RuntimeError: cuda runtime error (10) : invalid device ordinal at torch/csrc/cuda/Module.cpp:32

Please tell me how to solve this problem?

@michaellee666
Copy link

You might be getting that error if the pre-trained model is trained on a different number of Cuda devices. For example, while training the model you used 3 Cuda devices and now you are loading the same trained model on a device with only a single Cuda device.

@jdesouza-ai
Copy link

RuntimeError: cuda runtime error (10) : invalid device ordinal at torch/csrc/cuda/Module.cpp:32

Please tell me how to solve this problem?

@ashergaga I am also getting the same problem - did you ever resolve this?

@jdesouza-ai
Copy link

Hi - I just solved this. When you run the command for evaluation in the docs it says gpu 1 - change this to gpu 0.

python main.py --cfg cfg/eval_birds.yml --gpu 0

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