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?


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.


I had the same issue, this helped:

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