Load_learner on Windows: PermissionError


I trained my model using Colab. I exported the model (learn.export()).
I have an issue on Windows 10.
the problem is when I use the following command
load_learner(‘C:/Python/Test/Model/’) (export.pkl is inside the directory Model).
I got the following error:
File “C:\Users…\Anaconda3\envs\fastai\lib\site-packages\torch\serialization.py”, line 210, in init
** super(_open_file, self). init (open(name, mode))**
PermissionError: [Errno 13] Permission denied: 'C:/Python/Test/Model/'

The directory have a read/Write access. I also try moving the model to a different directory but I got the same error.

The following command run fine on Python: from fastai.vision.all import (To validate that I can import the library)



I would try this on paperspace, but the Notebook takes ages to get up.

I suggest you try the below:

  1. Your path, the parameter passed to load_learner, points to a folder, not a file.
    instead of load_learner(‘C:/Python/Test/Model/’)
    try: load_learner(‘C:/Python/Test/Model/export.pkl’)
    or: load_learner(Path(‘C:/Python/Test/Model/export.pkl’))

  2. If the above doesn’t fir it, then looks like the process under which you run Jupyter doesn’t have access to the folder.
    you can try to run console (cmd, or powershell) as admin, and start jupyter from that console