I’m encountering a “Permission denied” error when attempting to load a PyTorch checkpoint from a different drive within my Anaconda environment.
I’m trying to load a checkpoint file located at D:GreaseLMsaved_modelsgreaselm using the torch.load function in my Python script. However, I consistently receive the following error message:
Traceback (most recent call last):
File "greaselm.py", line 610, in <module>
main(args)
File "greaselm.py", line 547, in main
evaluate(args, has_test_split, devices, kg)
File "greaselm.py", line 430, in evaluate
checkpoint = torch.load(load_model_path, map_location='cpu')
File "C:UsersUsuarioanaconda3envsgreaselmlibsite-packagestorchserialization.py", line 579, in load
with _open_file_like(f, 'rb') as opened_file:
File "C:UsersUsuarioanaconda3envsgreaselmlibsite-packagestorchserialization.py", line 230, in _open_file_like
return _open_file(name_or_buffer, mode)
File "C:UsersUsuarioanaconda3envsgreaselmlibsite-packagestorchserialization.py", line 211, in __init__
super(_open_file, self).__init__(open(name, mode))
PermissionError: [Errno 13] Permission denied: 'D:\GreaseLM\saved_models\greaselm'
I’ve tried several solutions, including running PyCharm as an administrator, granting permissions to my user account, and changing the location of the files folder, but none of them have resolved the issue.
Could anyone provide insights into how to resolve this permission error when loading a PyTorch checkpoint from a D:drive which i got by training the models? Any help would be greatly appreciated. Thank you!
I Ran PyCharm as Administrator: I launched PyCharm with administrator privileges, expecting that it would resolve any permission-related issues. However, the problem persisted, and I continued to receive the “Permission denied” error.
Granted Permissions to User Account: I manually granted full permissions to my user account for the directory containing the checkpoint files (D:GreaseLMsaved_modelsgreaselm). Despite this, the error persisted when attempting to load the checkpoint.
Changed Location of Files Folder: In an attempt to mitigate the issue, I relocated the files folder to a location within the different directories. However, this change did not resolve the permission error, and I continued to encounter the same issue.