You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
EBGAN.py give error raise TypeError('iteration over a 0-d tensor') TypeError: iteration over a 0-d tensor #10
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.
Activity
jmmcd commentedon May 23, 2018
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.