A walk with fastai2 - Vision - Study Group and Online Lectures Megathread

I don’t find the starter kernel that you’re referring to, the one that is linked in the notebook doesn’t show how to use test_dl.

1 Like

test_dl expects a list of file names to use. So just pass in said list to learn.dls.test_dl to do inference. In the comments it describes how to do inference on the test set (in terms of kernel setup)

1 Like

Thank you, I got that working. I have a doubt though, for Image data test_dl accepts a list of filenames but for other problems? Is there any documentation for that, I couldn’t find any.

It’s whatever your DataLoader is expecting to bring in. For tabular it was made special (we had to play with it hence why it’s dls.test_dl now). It applies the transforms to how the original validation DataLoader was done and whatever it’s input like was (this can be customized with rm_type_tfms but I haven’t played with it enough).

IE image problems want a path to an image of some form, tabular problems want a table, NLP want some collection of texts, etc (just as a general example)

1 Like

In your object detection video you mentioned to complete the inference part. I can‘t get it to work, are there any updates?

1 Like

@faib we’re still working on it, I haven’t had the time to focus on it yet.

@muellerzr, I was trying to participate in Bengali AI Kaggle competition! Can you recommend some of video lectures to watch from your online lectures, for that problem. I have already completed Jeremy’s fastAI Deep Learning for Coders and half of foundations, so I was thinking of not following along the entire lecture series

Just a curiosity, for the 06_Multimodal_Head_and_Kaggle example, would accuracy possibly be higher if trained on 3 separate learners? My thought is the shared loss on the three different heads would converge on a value that is optimal for the Combinational Loss, but calculating that loss and subtracting by the same loss on all 3 heads might sacrifice, say graphemes accuracy vs vowels?

There has already been some discussion on this:

1 Like

me too

Hi,
The last video lecture where @muellerzr modifies UNET for classification makes me wonder how flexible can you go in fastai2.
In my personal case, I am using some PyTorch code to perform multilabel classification on a dataset that has several images inside folders. Every folder has a overall label, but not the images. The code performs the following:

  1. Take the images and predict the k images that represent best the overall label
  2. Keep those images and perform classification using the overall label for them.

I am unsure how to modify learner to perform this behavior. Or you think that I should modify the one_cycle to perform this? Thanks

That’s actually modifying a PyTorch model, not per say fastai as all fastai models are PyTorch. (If we go through what the Unet is built off of you’ll see there is nothing special extra fastai does except for how layers are written (barely))

To me, that sounds like a two stage process you keep as two models (as one needs to happen before the next and it’s data needs to be prepared a specific way). But others can chime in too with ideas :slight_smile:

In one of the video lectures it is mentioned that the bbox convention for the points was bottom left and top right. I did have to modify the points in my dataset to be top left to bottom right for it to work though.
As can be seen in the provided notebook, the top left/bottom right convention applies as well:
{'000012.jpg': ([[155, 96, 351, 270]], ['car'])}

2 Likes

Yes I got that wrong. From the documentation:

x1, y1, x2, y2 where (x1,y1) is your top-left corner and (x2,y2) is your bottom-right corner

I’ll do my best to do the class tommorow night if I can, but do not be surprised if I delay it a day or two so I can get the material ready. It’s midterms this week and next week here :slight_smile:

Thanks in advance for understanding!

3 Likes

All the best for the midterms :slight_smile: We can wait :smiley: there is enough to catch up with :wink:

1 Like

Ditto. All the best on midterms and appreciate all you are doing

1 Like

For our Siamese example, we’ll be using the lowest level possible, which I know some of you may be happy about :slight_smile:

2 Likes

I have been having a hard time setting up the seed so that i can reproduce my notebooks.

   seed = 42
    random.seed(seed)
    os.environ['PYTHONHASHSEED'] = str(seed)
    np.random.seed(seed)
    torch.manual_seed(seed)
    torch.cuda.manual_seed(seed)
    torch.backends.cudnn.deterministic = True
    torch.backends.cudnn.benchmark = True

i call this right before i call my learner.
As per the docs i set num_workers = 0 while i make my dataloader.
but when i rerun my notebook i’m still getting variations. Any idea what i’m missing ?

The results vary significantly or closer to each other? I’ve heard one can’t strictly control randomness in GPU as you can in CPU there will always be slight difference.