Platform: Kaggle Kernels


I am trying to train a model with
learn = create_cnn(data, models.resnet34, metrics=error_rate)

I get the following error:
OSError: [Errno 30] Read-only file system: '../input/wildkraut/wildkraut/models'

My kernel has an internet connection, I refreshed the site and my GPU is on… I uploaded the dataset in a normal way and the dataBunch shows up… Thankful for any help <3

(William Horton) #42

You should pass the ‘model_dir’ keyword arg to create_cnn. You can set it to tmp/models


Great - thanks @wdhorton that seemed to work. I guess model_dir = '/tmp/models' tells the create_cnn that it should open up a new folder and save the created model inside? (Couldn’t find an explanation for the keyword arg neither in the docs, nor anywhere else…)

(William Horton) #44

Yes, by default it will save the models in a new directory under the data directory, but in the case of Kaggle the data directory is read only, which causes the error


I have a question regarding the fastai.widgets:
If I import the following like suggested in the video, I get an error.

from fastai.widgets import * 
losses,idxs = interp.top_losses()
top_loss_paths = data.valid_ds.x[idxs]

fd = FileDeleter(file_paths=top_loss_paths)`

Error: Object FileDeleter not found.

I was wondering, if there might be a problem with the widget itself?
(Little ping to @init_27 :slight_smile: you’re named in the list above for such cases? )

(Daniel Barbosa) #46

Is there any way to leverage fastai v1 on kaggle without setting num_workers=0? Using it makes training quite slow. As far as I can tell the kaggle team is working on it: Just wondering if anyone knows more.


(Sanyam Bhutani) #47

@piaoya Thanks, it looks like a change in the library, I’ll dig into it.

@danielnbarbosa From what I’ve understood: it happens when the CPU usage surges, the way around that might be to use smaller image resizing.

(Daniel Barbosa) #48

Ah, indeed! Thanks @init_27

(Danielh Carranza) #49

You can use num_workers=2 in kaggle kernels, that’s the maximum yet


In lesson 2 Jeremy showed us how to download pictures directly from txt-files (containing the urls of google-images). I tried this on kaggle but I had no sucess. Am I assuming right, that I have to download (licence-free) pictures otherwise and re-upload it to kaggles dataset-structure in order to use them?


I tried num_workers = 2 in fast-ai-v3-lesson-1 and got ERROR: Unexpected bus error encountered in worker. This might be caused by insufficient shared memory (shm).

(Mike Moloch) #52

Hey there, thanks for setting these up!

When just starting out I ran into these issues:

  1. The course1 v3 doc for Kaggle states [1] that data sets are setup for all kernels. That doesn’t seem to be the case for the PET-IIIT dataset. I assumed the data “was there” in some magical location that the notebook would have access to but it isn’t, You must download it. And it doesn’t go into “input” directory, it goes into /tmp
  2. I couldn’t download the dataset because I didn’t realize I had to enable the internet.
  3. I still couldn’t download the dataset because I didn’t realize I had to stop/restart (or “refresh the page”) before my notebook could access the internet.

Just putting this out there for other greenhorns who may not anticipate these basic issues.

[1] dl1 v3 docs - Kaggle Setup

(Mike Moloch) #53

what does ‘…/input/’ mean in this context? Did you mean ../intput/? maybe three dots mean something in kaggle kernels? in that case I’m not sure.


I am absolutely new to Kaggle. When I am running lesson-1, the command path = untar_data(URLs.PETS); path is giving the below error.
ConnectionError: HTTPSConnectionPool(host=‘’, port=443): Max retries exceeded with url: /fast-ai-imageclas/oxford-iiit-pet.tgz (Caused by NewConnectionError(’<urllib3.connection.VerifiedHTTPSConnection object at 0x7fb3daadb940>: Failed to establish a new connection: [Errno -3] Temporary failure in name resolution’,))

My internet is on, GPU is on. I don’t have any amazon account. Not sure how to proceed.
Appreciate any help!!

(Mike Moloch) #55

Did you restart your kernel? Try refreshing your page.


I went to Kaggle home and stopped the kernel. After some time, I tried again and I am getting the same error.

(Mike Moloch) #57

I’m sorry to hear that. I was getting this error and enabling the internet and then restarting the kernel made the error go away. I’m pretty new to Kaggle kernels myself, so I’m not sure what could be going on. Maybe someone else will be able to help.

(Alejandro Dau) #59

It seems that Kaggle by default blocks the internet access of the virtual machine you are using for the notebook. You need to manually enable it (and provide a phone number where they will send you an SMS for verification to try to prevent abuse of the service). You can find it in the right pane near the bottom of the page.
Probably this new extra step should be added to the guide at


I want to save a df I created. If I enter df.to_csv() I get an this message OSError: [Errno 30] Read-only file system: '../input/labels.csv'. How can I save my csv-file on kaggle? Thankful for any help <3

(Sanyam Bhutani) #61

You need to set the saving path to the writeable directory where your notebook resides. It should work then.