Platform: Kaggle Kernels

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

2 Likes

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? )

1 Like

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: https://www.kaggle.com/product-feedback/72606#latest-429470. Just wondering if anyone knows more.

Thanks.

1 Like

@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.

1 Like

Ah, indeed! Thanks @init_27

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).

Hey there, thanks for setting these up!

When just starting out I ran into these issues:

  1. The fast.ai 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] fast.ai dl1 v3 docs - Kaggle Setup

1 Like

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=ā€˜s3.amazonaws.comā€™, 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!!

1 Like

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.

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.

1 Like

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 https://course.fast.ai/start_kaggle.html

3 Likes

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

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

Thank you @init_27 for your answer - I think youā€™re right, as it works like that for the models, too. But in case of the csv-files, I have no clue how to do that, though. I had a look at the parameters on pandas documentary, but there is no such argument, is there?
https://pandas.pydata.org/pandas-docs/stable/reference/api/pandas.DataFrame.to_csv.html?highlight=csv#pandas.DataFrame.to_csv

1 Like

Hi,
Path is indeed mentioned in the doc link shared by you,

path_or_buf : str or file handle, default None
File path or object, if None is provided the result is returned as a string.

Changed in version 0.24.0: Was previously named ā€œpathā€ for Series.

Just make sure you pass it as the parameter,m it should show on Shift+Tab completion.

1 Like

Kaggle still seems to be using fastai 1.0.39.

Does anyone know how often they update or can this be done for ourselves ?