Platform: Kaggle Kernels

@init_27
I am running through a second pass at fastai part 1 with the v1 version. Would be happy to assist in updating the notebooks and keep them up to date.

1 Like

That’ll be great! Thanks! I’ll add you as a contributor to all of the kernels.

I’m guessing since the notebooks have all been updated to v2-it might need some manual installations to get them working.

Hi Guys! I have a problem with Lesson 2. I’ve literally copied and pasted the Kaggle Notebook into a new Kaggle notebook (so I can toy with it) but when I run this code:

!cp …/input/* {path}/

I get this error:

cp: -r not specified; omitting directory ‘…/input/fastail2’

I’m using the fastail2 dataset. Nothing works after this point and I’ve tried to solve it for 2 hours straight and it’s really frustrating, please help!

According to the error fastail2 is a directory so cp won’t work as cp copies single files. You need to use -r

Try:
!cp -r ......

and see if that works.

1 Like

That fixes the error for that cell! Unfortunately another error pops up on the next block :frowning:
Code I entered:

download_images(path/file, dest, max_pics=200)

Result:

FileNotFoundError Traceback (most recent call last)
in
----> 1 download_images(path/file, dest, max_pics=200)
/opt/conda/lib/python3.7/site-packages/fastai/vision/data.py in download_images(urls, dest, max_pics, max_workers, timeout)
192 def download_images(urls:Union[Path, str], dest:PathOrStr, max_pics:int=1000, max_workers:int=8, timeout=4):
193 “Download images listed in text file urls to path dest, at most max_pics"
–> 194 urls = list(filter(None, open(urls).read().strip().split(”\n")))[:max_pics]
195 dest = Path(dest)
196 dest.mkdir(exist_ok=True)
FileNotFoundError: [Errno 2] No such file or directory: ‘data/bears/urls_black.txt’

How were you able to find the solution to the problem so quickly? I wasn’t able to find it after 2 hours of searching (lol I’m a noob i guess). Also, how come when I copy the original copy of lesson 2 on Kaggle everything works fine, but when I copy and paste the code into another doc it screws up? Is this an error on my end or on Kaggle’s end?

Glad the other solution helped :slight_smile: I have not personally copied and pasted the Kaggle notebook you mentioned so maybe someone who has can help you out. I am just going by the error messages.

In this case can you check to see that you really do have urls_black.txt file in the data/bears folder(or if that directory exists). The error message is being generated because download_images is looking for a text file that contains the urls. Hope that helps.

1 Like

Thanks! :slight_smile: The urls_black.txt isn’t in the data/bears folder. But I can’t move urls_black.txt into the data/bears folder because the urls_black.txt file is inside the input part while the data/bears folder is in the output.

How do you practice the FastAI stuff if you’re not making a Kaggle file to run it? Do you use other programs or other packages?

Thanks for you help!

I use google colab, always have and probably always will when I don’t have access to it locally. You probably will not be able to just walk through the entire thing on kaggle without headaches as the course presumes your own jupyter environment of some degree, rather than Kaggle (specifically the deployment lesson, just as how on Colab you can’t use widgets, so it’s a give and take).

It’s still good to learn how to use it in Kaggle, so you can use it with competitions however :slight_smile:

1 Like

Thread, I will update all existing notebooks to fastai2 once the new course goes live, ETA is <1 month approx.

Please let me know if anyone would be interested in helping maintain these: all we need to do is check every 1-2 weeks if notebooks are working fine.
cc: @muellerzr

2 Likes

Thanks muellerzr and amritz for your help! :slight_smile:

1 Like

so in this case you would have to move the file from the input folder to the output folder. This can also be done by using cp:

!cp '../input/{file to transfer}' '../output/{file location}'

so for example if urls_black.txt is in the input folder:

!cp '..input/urls_black.txt' '../output/data/bears/urls_black.txt'

will move the file between the folders.

In some cases the above may throw an error if the bears folder does not exist in the output folder so you would have to first create it:

Path('../output/data/bears/').mkdir(exist_ok=True, parents=True)

Hope that helps.

2 Likes