Skip to content

Errors when testing on CPU #154

@bryanbocao

Description

@bryanbocao
layer_name: <class 'torch.nn.modules.conv.Conv2d'>, total_params: 15121584, total_traina_params: 15121584, n_layers: 39
device:  cpu
Traceback (most recent call last):
  File "main.py", line 208, in <module>
    test(epoch)
  File "main.py", line 189, in test
    outputs = net(inputs)
  File "/home/brcao/Apps/anaconda3/envs/yolo/lib/python3.8/site-packages/torch/nn/modules/module.py", line 727, in _call_impl
    result = self.forward(*input, **kwargs)
  File "/home/brcao/Repos/pytorch-cifar/models/dla_simple.py", line 106, in forward
    out = self.base(x)
  File "/home/brcao/Apps/anaconda3/envs/yolo/lib/python3.8/site-packages/torch/nn/modules/module.py", line 727, in _call_impl
    result = self.forward(*input, **kwargs)
  File "/home/brcao/Apps/anaconda3/envs/yolo/lib/python3.8/site-packages/torch/nn/modules/container.py", line 117, in forward
    input = module(input)
  File "/home/brcao/Apps/anaconda3/envs/yolo/lib/python3.8/site-packages/torch/nn/modules/module.py", line 727, in _call_impl
    result = self.forward(*input, **kwargs)
  File "/home/brcao/Apps/anaconda3/envs/yolo/lib/python3.8/site-packages/torch/nn/modules/conv.py", line 423, in forward
    return self._conv_forward(input, self.weight)
  File "/home/brcao/Apps/anaconda3/envs/yolo/lib/python3.8/site-packages/torch/nn/modules/conv.py", line 419, in _conv_forward
    return F.conv2d(input, weight, self.bias, self.stride,
RuntimeError: Expected object of device type cuda but got device type cpu for argument #1 'self' in call to _thnn_conv2d_forward

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions