Hello guys,
I came here with a particular question about Dataloader, Could I introduce cuda nn modules in call?
I am having problems with CUDA initialization but I didn’t find the answer. Thank you so much in advanced. The error I am having happens when I use .cuda()
or torch.cuda.FloatTensor()
, I describe the problem below:
RuntimeError: CUDA error: initialization error
Dataloader and reading data
class SomeNetwork(object):
def __init__(self,parama=1,paramb=2,paramc=3):
self.net = nn.net(self,parama=1,paramb=2,paramc=3)).cuda() # CUDA
def __call__(self, x):
self.net(x[None,:].cuda())
return x[0]
transformations.extend([ transforms.ToTensor(),
SomeNetwork(),
transforms.ToPILImage(),
trainset = ImageNet(root='./Database/',
split='train',
transform=transforms.Compose(transformations),
target_transform=None,)