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
AttributeError Traceback (most recent call last) in <cell line: 95>()
94
95 if name == 'main':
---> 96 main()
in call(self, x, index)
45 # print('one_hot after backward:', one_hot)
46
---> 47 x.grad.data.zero_() # Reset the gradient to zero
48
49 # print('x=', x)
AttributeError: 'NoneType' object has no attribute 'data'
The error message indicates that NoneType object has no attribute data because the gradient (x.grad) is still None after calling one_hot.backward(). This means that the gradient calculation failed for some reason.
The text was updated successfully, but these errors were encountered:
AttributeError Traceback (most recent call last)
in <cell line: 95>()
94
95 if name == 'main':
---> 96 main()
in call(self, x, index)
45 # print('one_hot after backward:', one_hot)
46
---> 47 x.grad.data.zero_() # Reset the gradient to zero
48
49 # print('x=', x)
AttributeError: 'NoneType' object has no attribute 'data'
The error message indicates that NoneType object has no attribute data because the gradient (x.grad) is still None after calling one_hot.backward(). This means that the gradient calculation failed for some reason.
The text was updated successfully, but these errors were encountered: