question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Parameter "device" in SupervisedRunner has no effect

See original GitHub issue

🐛 Bug Report

When running with device=torch.device('cuda:0') or device='cuda:0' model still uses all the GPUs. When running with device=torch.device('cpu') or device='cpu' an error RuntimeError: module must have its parameters and buffers on device cuda:0 (device_ids[0]) but found one of them on device: cpu appears.

How To Reproduce

Run any sort of training using SupervisedRunner(device=torch.device('cpu')) or SupervisedRunner(device=torch.device('cuda:0')) on a machine with multiple GPUs.

Environment

PyTorch version: 1.5.0
OS: Ubuntu 18.04
Python version: 3.7
CUDA runtime version: 10.2```

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Reactions:2
  • Comments:7 (6 by maintainers)

github_iconTop GitHub Comments

1reaction
yhn112commented, May 8, 2020

I certainly do use CUDA_VISIBLE_DEVICES. It doesn’t help me deal with such severe bugs in such a popular framework. =)

0reactions
Scitatorcommented, May 19, 2020
Read more comments on GitHub >

github_iconTop Results From Across the Web

DL — Catalyst 20.06 documentation
Traces model using created experiment and runner. Parameters. logdir (Union[str, Path]) – Path to Catalyst logdir with model. checkpoint_name (str) – Name ...
Read more >
Why PyTorch nn.Module.cuda() not moving Module tensor but ...
If you define a tensor inside the module it needs to be registered as either a parameter or a buffer so that the...
Read more >
8 Creators and Core Contributors Talk About Their Model ...
parameter freezing,; and TensorBoard and Neptune integration. If this is not enough to satisfy your customization needs, we took pains to ...
Read more >
torch.nn.modules.module — DGL 0.9.1post1 documentation
It can modify the input inplace but it will not have effect on forward ... Args: device (int, optional): if specified, all parameters...
Read more >
torch.nn.modules.module — transformers 4.12.5 documentation
It can modify the input inplace but it will not have effect on forward ... Args: device (int, optional): if specified, all parameters...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found