I had this problem when I run my auto-encoder.
the full report shows as following:
Traceback (most recent call last):
  File "main.py", line 279, in <module>
    trainLoss, trainTime, loadingTime = train(epoch)
  File "main.py", line 214, in train
    loss_r, loss_p, target = wrap_net(hinputs, ginputs, args.per_w).cpu()
  File "/home/isaac/anaconda3/lib/python3.7/site-packages/torch/nn/modules/module.py", line 493, in __call__
    result = self.forward(*input, **kwargs)
  File "main.py", line 125, in forward
    out_r = self.net(img)       # state: b 3 224 224
  File "/home/isaac/anaconda3/lib/python3.7/site-packages/torch/nn/modules/module.py", line 493, in __call__
    result = self.forward(*input, **kwargs)
  File "/home/isaac/Dehaze0.4/MyNet.py", line 266, in forward
    out_f = self.decoder(out1, relu1_1, relu2_1, relu3_1, idx1, idx2, idx3, p1, p2, p)
  File "/home/isaac/anaconda3/lib/python3.7/site-packages/torch/nn/modules/module.py", line 493, in __call__
    result = self.forward(*input, **kwargs)
  File "/home/isaac/Dehaze0.4/MyNet.py", line 190, in forward
    relu3_1 = gn1(relu3_1)
  File "/home/isaac/anaconda3/lib/python3.7/site-packages/torch/nn/modules/module.py", line 493, in __call__
    result = self.forward(*input, **kwargs)
  File "/home/isaac/anaconda3/lib/python3.7/site-packages/torch/nn/modules/normalization.py", line 232, in forward
    input, self.num_groups, self.weight, self.bias, self.eps)
  File "/home/isaac/anaconda3/lib/python3.7/site-packages/torch/nn/functional.py", line 1736, in group_norm
    torch.backends.cudnn.enabled)
RuntimeError: Expected object of backend CPU but got backend CUDA for argument #3 'tensor1'

Even I put all net in main.py into CPU type, it gives the same error. Could you give me some advice to correct this error? Thank you.
Isaac