BN2d may fail on nividia GPU.
I think there is something wrong when pytorch BN layer meets with CUDNN.
Error Traceback:
File “/home/yplu/resnet/cifar/Resnet.py”,
line 123, in forward
out = out + self.basic_blocki
File “/opt/software/anaconda3-4.4.0/lib/python3.6/site-packages/torch/nn/modules/module.py”,
line 206, in call
result = self.forward(*input, **kwargs)
File “/home/yplu/resnet/cifar/Resnet.py”, line 77, in forward
out = self.bn1(x)
File “/opt/software/anaconda3-4.4.0/lib/python3.6/site-packages/torch/nn/modules/module.py”, line 206, in call
result = self.forward(*input, **kwargs)
File “/opt/software/anaconda3-4.4.0/lib/python3.6/site-packages/torch/nn/modules/batchnorm.py”, line 43, in forward
self.training, self.momentum, self.eps)
File “/opt/software/anaconda3-4.4.0/lib/python3.6/site-packages/torch/nn/functional.py”, line 463, in batch_norm
return f(input, weight, bias)
RuntimeError: std::bad_cast
Code can be found from:

  
      github.com
  
  
    2prime/DeepLab/blob/master/ResNet/models/Resnet.py 4
import torch
import torchvision
import torch.nn as nn
import torch.nn.functional as functional

from torch.autograd import Variable

from msra_init import msra_init


import torchvision.transforms as transforms

from torch.autograd import Variable

import torch.optim as optim

import os

from file_control import *



  This file has been truncated. show original