eladhoffer / convNet.pytorch

ConvNet training using pytorch
MIT License
345 stars 88 forks source link

AttributeError: 'Image' object has no attribute 'new' #6

Closed Coderx7 closed 6 years ago

Coderx7 commented 6 years ago

Hi, Why am I facing this error ? its complaining about this line: alpha = img.new().resize_(3).normal_(0, self.alphastd)

Whats wrong here? I'm using Pytorch 0.4

Coderx7 commented 6 years ago

Found the cause of the error! I had to use transform.ToTensor() prior to calling the Lighting() method. failing to do so results in an PIL image being sent as the input for lightining() which expects a Tensor and thats why the error occurs.