I’m working on doing Pneumonia detection using Chest X-rays Image data found in Kaggle. But I’m having trouble finding the best learning rate when I execute the line
I get the below error;
OSError: [Errno 30] Read-only file system: '/kaggle/input/chest-xray-pneumonia/chest_xray/models'
To give you some context about my data, here is how my directory is organized
The weird thing is that when I try to find the best lr when using a fastai available dataset like the PETS one, it works perfectly fine and finds the best lr.
And by the way, I’m using fastai version 2.7.12 which is the latest version
So kindly help me fix this error.
In Kaggle kernels, the “/kaggle/input” directory is read-only, so you need to use “/kaggle/working” directory which is read-write.
It can be done if you give the “model_dir” parameter for your Learner (the default is model_dir=‘models’)
Example: vision_learner(dls, resnet34, model_dir=‘/kaggle/working/models’)
You can see vision_learner’s parameters here (but it works with other learners too):
Other older similar cases:
Hi i’m having this error on kaggle when I try to use create_cnn
OSError Traceback (most recent call last)
----> 1 learn = create_cnn(data, models.resnet34, metrics=error_rate)
/opt/conda/lib/python3.6/site-packages/fastai/vision/learner.py in create_cnn(data, arch, cut, pretrained, lin_ftrs, ps, custom_head, split_on, bn_final, **kwargs)
57 head = custom_head or create_head(nf, data.c, lin_ftrs, ps=ps, bn_final=bn_final)
58 model =…
@AmorfEvo your solution has really worked for me. The use of
model_dir='/kaggle/working/models' works and fixes the issue.
Thanks a lot