AttributeError: module 'torch' has no attribute 'set_grad_enabled'
Traceback (most recent call last): File "/home/thaqafi/PycharmProjects/transfer_learning/tutorial_transfer.py", line 280, in
model_ft = train_model(model_ft, criterion, optimizer_ft, exp_lr_scheduler, num_epochs=25)
File "/home/thaqafi/PycharmProjects/transfer_learning/tutorial_transfer.py", line 179, in train_model with torch.set_grad_enabled(True):
AttributeError: module 'torch' has no attribute 'set_grad_enabled'
using source code form Pytorch webiste.
http://pytorch.org/tutorials/beginner/transfer_learning_tutorial.html