torch.grad removed in PyTorch 1.8.1?
jszym opened this issue · 2 comments
jszym commented
I'm getting the following error with PyTorch 1.8.1
AttributeError: module 'torch' has no attribute 'grad'
Swapping Line 515 for with torch.enable_grad():
seems to resolve the error.
I can't find it in the 1.8 release notes, but it appears torch.grad()
might be deprecated? Not sure if anyone else can replicate.
Cheers!
lessw2020 commented
Hi @jszym - thanks for the update!
I'm literally upgrading to Pytorch 1.8 as I type...so will see if this is indeed the issue and update if so, though this sounds like a bit of an annoyance to have to check on which version of torch to then determine how to enable grad exactly.
anyway, will find out once I upgrade.
Leaving this open until I can resolve, thanks again for pointing it out!