The error is in the above line no 190 .... Below Code worked for me .. am i Correct ? I removed word list and [0] if (self.margin-D_fake_err.data) > 0: D_loss = D_real_err + (self.margin - D_fake_err) else: D_loss = D_real_err self.train_hist['D_loss'].append(D_loss.data[0])
I think this is the same error I saw, due to an update in the pytorch API. The suggested change is to replace .data[0] with .data.item(). My pull request has this fix.
if list(self.margin-D_fake_err.data)[0] > 0: D_loss = D_real_err + (self.margin - D_fake_err) else: D_loss = D_real_err self.train_hist['D_loss'].append(D_loss.data[0])
The error is in the above line no 190 .... Below Code worked for me .. am i Correct ? I removed word list and [0]
if (self.margin-D_fake_err.data) > 0: D_loss = D_real_err + (self.margin - D_fake_err) else: D_loss = D_real_err self.train_hist['D_loss'].append(D_loss.data[0])