Real-time-GesRec: cuda gpu device Error

Hi.

I have 1 GPU in my computer but I got this error. I’m newbie of Pytorch so I don’t know this Error’s meaning.

Traceback (most recent call last):
  File "main.py", line 177, in <module>
    train_logger, train_batch_logger)
  File "/home/eden/Real-time-GesRec/train.py", line 34, in train_epoch
    outputs = model(inputs)
  File "/home/eden/anaconda3/envs/gesrec/lib/python3.7/site-packages/torch/nn/modules/module.py", line 493, in __call__
    result = self.forward(*input, **kwargs)
  File "/home/eden/anaconda3/envs/gesrec/lib/python3.7/site-packages/torch/nn/parallel/data_parallel.py", line 146, in forward
    "them on device: {}".format(self.src_device_obj, t.device))
RuntimeError: module must have its parameters and buffers on device cuda:0 (device_ids[0]) but found one of them on device: cpu

About this issue

  • Original URL
  • State: open
  • Created 5 years ago
  • Comments: 18 (11 by maintainers)

Most upvoted comments

model, parameters = generate_model(opt) model = model.cuda()

Add the sentence above.