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
Error message: p.grad.data.mul_(1.0 / meta_batch_size)
AttributeError: 'NoneType' object has no attribute 'data'
For lines;
# Average the accumulated gradients and optimize
for p in maml.parameters():
print(p)
p.grad.data.mul_(1.0 / meta_batch_size)
opt.step()
I encountered the error message in #387 and did as recommended, added the parameter allow_unused=True.
Would it be wrong if I changed the aforementioned lines to:
with torch.no_grad():
for p in maml.parameters():
if p.grad is not None:
p.grad.data.mul_(1.0 / meta_batch_size)
opt.step()
The text was updated successfully, but these errors were encountered:
Error message: p.grad.data.mul_(1.0 / meta_batch_size)
AttributeError: 'NoneType' object has no attribute 'data'
For lines;
# Average the accumulated gradients and optimize
for p in maml.parameters():
print(p)
p.grad.data.mul_(1.0 / meta_batch_size)
opt.step()
I encountered the error message in #387 and did as recommended, added the parameter allow_unused=True.
Would it be wrong if I changed the aforementioned lines to:
with torch.no_grad():
for p in maml.parameters():
if p.grad is not None:
p.grad.data.mul_(1.0 / meta_batch_size)
opt.step()
The text was updated successfully, but these errors were encountered: