[BUG] AttributeError: module 'torch._C' has no attribute 'set_grad_enabled'
ahalev opened this issue · comments
Avishai Halev commented
File "/home/ahalev/miniconda3/envs/eye-image-env/lib/python3.8/site-packages/timm/loss/asymmetric_loss.py", line 40, in forward
torch._C.set_grad_enabled(False)
AttributeError: module 'torch._C' has no attribute 'set_grad_enabled'
New versions of torch deprecated torch._C.set_grad_enabled
in favor of torch.set_grad_enabled, leading to an AttributeError here:
pytorch-image-models/timm/loss/asymmetric_loss.py
Lines 39 to 40 in 59b3d86