How to export the model on Kaggle

Hi Everyone

I have trained a model on Kaggle and now would like to export it (on my PC):

When I am using this code, its throwing me following error;

Code: learn.export(‘devanagari_model.pkl’)
Error: Read-only file system: ‘…/input/devanagari/devanagari_model.pkl’

What can I do to resolve this?

BR
Abhik

Yes kaggle use read-only file system and that means you can not export your model to there. You can give an adress parameter to export() . I don’t remember how it was exactly but you can find it quickly. You can change adress to (’/tmpt/models’).Regards

Change your directory to /kaggle/working and make the exported model as output and commit the kernel. You would be able to download the output when the kernel is run completely.

2 Likes

I had the same issue, this helped:

learn.export(file = Path("/kaggle/working/export.pkl"))

5 Likes