OSError: [Errno 30] Read-only file system: '/storage/data/oxford-iiit-pet/export.pkl' (using fastai library)

Hi guys,

I am working in a gradient notebook in Paperspace. I am using the PETS dataset in the fastai library to save and deploy the Classifying breeds. When I use the learn.export() command, I am getting the error OSError: [Errno 30] Read-only file system: ‘/storage/data/oxford-iiit-pet/export.pkl’.

I read some of the problems of the same topics in the forum, but still, I have a problem.

Any advice is appreciated.

I ran into the same problem. I think you cannot write into this ‘/storage/data/oxford-iiit-pet/’ path, can only read from it.
So when you create the “.pkl” file make sure you are creating in a different path.

If you have coded something like this :-

dls = ImageDataLoaders.from_name_func(path, get_image_files(path00), … … )
by specifying the path variable you can make sure the learn.path is the same as the path you have given in defining dls. So when the "export.pkl " file is created it is stored in the path you have mentioned.

if you have created a datablock object and then while creating a dataloader you can specify the path. This will let you store the export.pkl file in path you have mentioned.
Hope this helps. If there is any mistake please let me know.

Thank you so much, Yoghes. It works now.

Hello. Unfortunately I’m getting this error in a Paperspace gradient notebook and I can’t see how to apply Yoghes’s fix :worried:

Literally the first cell to run in the whole book and I get this error:

FileExistsError: [Errno 17] File exists: '/storage/data/oxford-iiit-pet'

Caused by this line:

path = untar_data(URLs.PETS)/'images'

Can anyone advise please? I feel like such a noob!