General course chat

Hey guys, I’m like really new to fast.ai so I am a bit reluctant for posting my question as a topic since I am sure that it has been answered before.

I wanted to get started on course-v3, part one and while I was setting up my Jupyter Notebook, I tried to get access to the files of the version 3 course but I was unable to. When I try to change my directory it says it can’t access it, although it does have access to course-v4. What I see in terminal is shown below through this screenshot:

I’m able to pull the course-v4 just fine but it does not align with the notebooks in this lesson

How would you guys recommend getting access to the course-v3 files? I also tried to download and upload them locally but that didn’t work out either. Thank you!

what you might have done is pressed ‘cd’ and then pressed enter. Thus you are in the second highest directory ‘/root’ and you cant run commands from there because you aren’t in teh right directory. What I would do (and what I think is the easiest way) is just go back to jupyter notebook (top left hand corner of the screen) and then just click on a terminal again. After starting the terminal, type ‘pwd’ to see what directory you are in. It should say ‘/notebooks’. After that you shouldn’t have any problems :slight_smile:

Thank you for your reply and screenshot! I found my mistake, when I made my Notebook I had selected it to be for fast.ai v4 hence the reason I could not get into the course-v3 directory. I had assumed them to be the same but I found the v3 version and everything works well.

Thanks for your help, I appreciate it.

1 Like

Hello, fellow coders! :grin:

I finished Lesson 1: Deep Learning 2019 - Image classification! Thank you, thank you, please hold your applause. :sweat_smile:

Postmortem

No surprise, fast.ai did the lesson well, and I appreciate Mr. Howard’s plain teaching style. I’ve had unnecessarily pedantic teachers that get in the way of learning. I think there’s a place for both teaching styles, for an intro course though Mr. Howard nails it. It’s refreshing to learn an advanced topic with applications first then theory. It boosts my motivation. My only feedback is to maybe record with a better microphone for v4. Sometimes when Mr. Howard says the letter “s,” it spikes the volume and makes it harder to listen with loud volume, which is important to me because I’m a little deaf. :ear: :laughing:

You do a great job of framing the rapid progress in the field! It’s incredible how we can beat the state-of-the-art breed classification for dogs and casts from less than a decade ago with a few code lines. I’m excited about further lessons!

For homework, I want to build my classifier, any dataset suggestions?

Follow-up Questions

  1. When I run the code today, I get this warning on many of the output cells, including fitting one cycle:
/usr/local/lib/python3.6/dist-packages/torch/nn/functional.py:2854: UserWarning: The default behavior for interpolate/upsample with float scale_factor will change in 1.6.0 to align with other frameworks/libraries, and use scale_factor directly, instead of relying on the computed output size. If you wish to keep the old behavior, please set recompute_scale_factor=True. See the documentation of nn.Upsample for details. 
warnings.warn("The default behavior for interpolate/upsample with float scale_factor will change "

I’m running the code on Google Colab, with the latest version of
!curl -s https://course.fast.ai/setup/colab | bash

It mentions to set recompute_scale_factor=True to keep old behavior, yet I can’t find that as a paremeter of the function fit_one_cycle().

Does anyone else have this warning, and is there any way to disable it? Please, my notebook is filled with these warnings! :laughing:

  1. May someone smarter than me please explain r'/([^/]+)_\d+.jpg$' :confused: ?

I’ve studied the basics of regex expressions, but I can’t figure out how this code works. Individually, what does [^/]+ do? I know the + means one or more of the brackets, thus does it mean to match the start of the subgroup to start with /? I also don’t understand what the brackets do here. I tried designing my regex with the modifiers /(.*) to grab any character after the /, but it predictably catches the whole path, not just the end. Thanks for the help! :partying_face:

You can remove the warnings by following @oo92’s instructions here. This means
adding a new cell after the colab setup statement and running the command
!pip install "torch==1.4" "torchvision==0.5.0"

[^/] is saying match any character that is not a slash .
[^/]+ is saying match 1 or more characters that is not a slash
([^/]+) is saying group the set that matches 1 or more characters that is not a slash
/([^/]+)_ is saying group the set that matches 1 or more characters that is not a slash but is prefixed by a slash and followed by an underscore .This will filter out any matches on the directory path (which do have slashes) if they dont have underscores. It will only match the filename which has an underscore to separate a digit from the name of the species..
/([^/]+)_\d+ is saying the same as above plus should be followed by 1 or more digits
/([^/]+)_\d+.jpg is saying the same as above plus should be followed by any character plus the sequence jpg
/([^/]+)_\d+.jpg$ is saying the same as above but followed by the end of the string (ie. no more characters).

Regexes are complicated to grok and it took me a while to understand them too. There are websites that allow you to play with regexes and can help you debug them if you are still having problems.

Hope this helps.

Best regards,
Butch

5 Likes

Thanks Butch, this helped a lot! :smile:

path=untar_data(URLs.PETS)
path.ls()

i am getting an output as:
[WindowsPath(‘C:/Users/rajve/.fastai/data/oxford-iiit-pet/images’)] instead of [mages,annotation]

what to do?

Hello! I have a problem runing SageMaker instance from a template.
Where should I post to get help on that?
My problem is that start script seems to hang up during ‘update fast ai library’ step.
I already tried modifying the script like so:
https://aws.amazon.com/premiumsupport/knowledge-center/sagemaker-lifecycle-script-timeout/
What could be the problem?

this is the suggested link to create large databases from the course. please check it out

Hi bagnica I hope you are having a wonderful day!

Unfortunately I use Google Colab not Sagemaker so I can’t help you with the specifics.

However I had a similar problem when trying to deploy an app to a cloud provider.

It turned out that anaconda wouldn’t let me install certain prerequisites for the version of fastai I was using as it was an old version of fastai. The problem was the cloud provider service was hanging so I couldn’t see or check what was happening.

As I have anaconda on my desktop machine I was able to run the scripts locally and saw the error messages rather than the frozen screen. If the screen froze I used ctrl+z to break out of it.
I then used pip freeze to see what libraries had been installed and used pip install to install the libraries that anaconda was hanging on.

Hopefully someone who uses Sagemaker can give you some more help.

Cheers mrfabulous1 :grinning: :grinning:

Hello all!

Just started the course yesterday. I was doing the lesson2-download suggested practice from the first lecture, and scraped 27 images of each of mountains, rivers and deserts from google. After calling learn.recorder.plot() I get a graph like this:

image

which is generally decreasing as the learning rate increases, unlike in the lecture where the learning rate increases. Any pointers as to why this is occurring for my model?

1 Like

Hey,

The solution is to change the script recommend
replace-> conda install -y fastai -c fastai
with-> nohup /home/ec2-user/anaconda3/bin/conda install -y fastai -c fastai -v &**

I cant upload a patch for smmeresean into GitHub. I asked someone to help their and its documented under: https://github.com/fastai/course-v3/issues/518

My dataset doesn’t have a normalized distribution, and I am struggling with getting a low validation loss with collaborative filtering. I want to use collaborative filtering, so what can I do to lower the loss?

Thanks :smiling_face_with_three_hearts:

1 Like

I have some image data from csv with names train.csv, valid.csv, test.csv. So how can we load the training data only from train.csv and validation set only from valid.csv

1 Like

Hi,
I’m on lesson 2 stuck on the part with “Cleaning up”
I entered :

db = (ImageList.from_folder(path)
.split_none()
.label_from_folder()
.transform(get_transforms(), size=224)
.databunch()
)

and received an error:

NameError Traceback (most recent call last)
in
----> 1 db = (ImageList.from_folder(path)
2 .split_none()
3 .label_from_folder()
4 .transform(get_transforms(), size=224)
5 .databunch()

NameError: name ‘ImageList’ is not defined

I am not sure how to proceed from here and searched the forums. Any help appreciated, thank you!

1 Like

There must be a command above that cell that loads in the ImageList class via the fastapi library.

I imagine it would be this:

from fastai.vision import *

I would run all the cells above and run this again.

image

With resnet50, on applying learning rate finder i got this graph. From this graph it feels like using this range (1e-04 to 1e-02) will give better result compared to (1e-06 to 1e-04). But it is not the case. I am confused about it, can anyone explain ? This is from Lesson1

I am new to fast.ai and was trying to download the dataset ‘https://www.kaggle.com/karthikaditya147/junctions-images/Junctions-test’ present in Kaggle. But I was not able to figure out how I am supposed to use untar_data function to import the data in the notebook. Besides, that data have separate folders for testing and training, so how am I supposed to specify to my model to use the data present in the test folder to test the model accuracy and use the data in the train folder for training?