Torch.save(model.state_dict(), PATH) [Errno 13] Permission denied?

Made a folder in my drive and when I tried to save the model I get permission denied? How do I fix this? Windows 10 Pytorch 0.40 and the folder was already made.

Edited: I works now -> save.(model.state_dict(), ‘mode.pth’)

5 Likes

Thanks it worked for me

1 Like

I was doing the mistake of providing path but not file name.
Silly mistake …

PATH = “/home/folder1/folder2”
torch.save(model.state_dict(), os.path.join(PATH,“filename.pth”))

2 Likes

Silly me. Same mistake lol.