faster-rcnn.pytorch: can't train with cpu only

Because of some certain reason, I want to train the model with small data on a PC with no GPU. But Python gave me an AssertionError as I found here.

Traceback (most recent call last):
  File "/home/snowyjune/local/faster-rcnn.pytorch/faster-rcnn.pytorch/trainval_net.py", line 336, in <module>
    loss.backward()

  File "/home/snowyjune/anaconda3/lib/python3.6/site-packages/torch/tensor.py", line 93, in backward
    torch.autograd.backward(self, gradient, retain_graph, create_graph)

  File "/home/snowyjune/anaconda3/lib/python3.6/site-packages/torch/autograd/__init__.py", line 89, in backward
    allow_unreachable=True)  # allow_unreachable flag

  File "/home/snowyjune/local/faster-rcnn.pytorch/faster-rcnn.pytorch/lib/model/roi_align/functions/roi_align.py", line 38, in backward
    assert((self.feature_size is not None) and (grad_output.is_cuda))

AssertionError

It seems that the program is designed not to support training with CPU. Is that true?

About this issue

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

Most upvoted comments

@SnowyJune973 Sorry to bother, but did you succeeded in ‘sh make.sh’? Didn’t you get any cffi errors?