Dear sir,
I am a new guy,had issue with GPU training for cifar10_tutorial. CPU training code is fine!
My environment:
pytorch 0.2.0 py27hc03bea1_4cu80 [cuda80] soumith
torchvision 0.1.9 py27hdb88a65_1 soumith
code:
in 30: outputs = net.cuda(Variable(images))
I get:
RuntimeError Traceback (most recent call last)
in ()
----> 1 outputs = net.cuda(Variable(images))
/home/john/anaconda2/lib/python2.7/site-packages/torch/nn/modules/module.pyc in cuda(self, device_id)
145 copied to that device
146 “”"
–> 147 return self._apply(lambda t: t.cuda(device_id))
148
149 def cpu(self):
/home/john/anaconda2/lib/python2.7/site-packages/torch/nn/modules/module.pyc in _apply(self, fn)
116 def _apply(self, fn):
117 for module in self.children():
–> 118 module._apply(fn)
119
120 for param in self._parameters.values():
/home/john/anaconda2/lib/python2.7/site-packages/torch/nn/modules/module.pyc in _apply(self, fn)
122 # Variables stored in modules are graph leaves, and we don’t
123 # want to create copy nodes, so we have to unpack the data.
–> 124 param.data = fn(param.data)
125 if param._grad is not None:
126 param._grad.data = fn(param._grad.data)
/home/john/anaconda2/lib/python2.7/site-packages/torch/nn/modules/module.pyc in (t)
145 copied to that device
146 “”"
–> 147 return self._apply(lambda t: t.cuda(device_id))
148
149 def cpu(self):
/home/john/anaconda2/lib/python2.7/site-packages/torch/_utils.pyc in _cuda(self, device, async)
51 if device is None:
52 device = torch.cuda.current_device()
—> 53 if self.get_device() == device:
54 return self
55 else:
/home/john/anaconda2/lib/python2.7/site-packages/torch/autograd/variable.pyc in bool(self)
121 return False
122 raise RuntimeError(“bool value of Variable objects containing non-empty " +
–> 123 torch.typename(self.data) + " is ambiguous”)
124
125 nonzero = bool
RuntimeError: bool value of Variable objects containing non-empty torch.ByteTensor is ambiguous
Do anybody try the tutorial? Is this a known bug? How could I fix it?
Thanks
John