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

Absolutely you could! I will not have an example of this, I’m sorry. But I do know Jeremy and sgugger have it on their to-do’s.

I am confused on the transforms part. As in how we transform the multiple types?

That’s great! I would look for this docs.

Regarding the transforms, yes, I was thinking if you can apply different transforms to the different inputs ie transforms for images, transforms for text and so on and, if so, how do you specify it in the code.

I am still doing my best to get familiar with the transforms currently. I haven’t looked into that though. Perhaps post in another thread or v2 chat? So it can help others when you get an answer :slight_smile: (and find it easier than buried in this thread)

1 Like

Thank you.

FYI, sgugger posted about this. PyTorch released an update too. Use version 1.4.0

@muellerzr, can you please take a look at my post here Anomaly detection using fast.ai

I know that you will be covering tabular data later on in your course, but I just wanted to start playing around right away. Thank you!

Sorry @mrfabulous1, but I don´t have the deployment tutorial in english yet. It is important to point out that the tutorial is for fastai v1, not for fastai2. I believe it will be necessary to update it with the new library requirements.

2 Likes

I’ve updated the schedule above. This week along with what was originally posted we will go over what deployment looks like using a render template (which in reality is just Starlette) for most any scenario (images, text, and tabular) and running it on your local machine, and exploring and navigating the source code. I’ll release a link tomorrow morning!

Also, next week (week 3) we will go over K-Fold validation as well

2 Likes

Here is the link to today’s livestream:

The notebooks for today are (in order):

  • 02_MNIST
  • 02_SGD
  • 02_Deployment
6 Likes

Question: How do I get my labels in fastaiv2? Basically I would like to match the filename with the class in the get_y.

image

In fastaiv1 I used to do ImageList.from_df and then .label_from_df(cols=‘class’) but I could not found in the fastaiv2 documentation how to do it.

animals = DataBlock(blocks=(ImageBlock, CategoryBlock),
              get_items=get_image_files,
              splitter=RandomSplitter(0.2),
              get_y=???)

@mgloria you want ColReader, 03_Multi_Label shows this (Planets) :slight_smile: (along with a few different ways, we’ll walk through them all next week)

1 Like

Thanks @muellerzr! I get though an error I believe due to the fact that some of the images were corrupt. I unlinked them but they are still of course mentioned in the csv which I believe could be the issue.

animals = DataBlock(blocks=(ImageBlock, CategoryBlock),
                  get_items=ColReader(4, pref=f'{path}/train/'),
                  splitter=RandomSplitter(0.2),
                  get_y=ColReader(3))

batch_tfms=[*aug_transforms(size=224, max_warp=0), Normalize.from_stats(*imagenet_stats)]

dbunch = animals.databunch(df, batch_tfms=batch_tfms)

error:

---------------------------------------------------------------------------
KeyError                                  Traceback (most recent call last)
~/SageMaker/custom-miniconda/miniconda/envs/fastai2/lib/python3.6/site-packages/pandas/core/indexes/base.py in get_loc(self, key, method, tolerance)
   2896             try:
-> 2897                 return self._engine.get_loc(key)
   2898             except KeyError:

pandas/_libs/index.pyx in pandas._libs.index.IndexEngine.get_loc()

pandas/_libs/index.pyx in pandas._libs.index.IndexEngine.get_loc()

pandas/_libs/hashtable_class_helper.pxi in pandas._libs.hashtable.PyObjectHashTable.get_item()

pandas/_libs/hashtable_class_helper.pxi in pandas._libs.hashtable.PyObjectHashTable.get_item()

KeyError: 4

During handling of the above exception, another exception occurred:

KeyError                                  Traceback (most recent call last)
<ipython-input-17-21ecc1e0890b> in <module>
----> 1 dbunch = animals.databunch(df, batch_tfms=batch_tfms)

Is it really due to this? If so, is there a way to get back the name of the unlinked files so that I can remove those rows from the df. I feel it is a very common situation having some corrupt images.

I’d try defining a get_x and a get_y explicitly and seeing from there :slight_smile:

1 Like

Had to make a quick fix:

4 Likes

I can hear you on the stream.

is rank the same as dimension?

you can have a 2 dimensions which is rank 1.
This corresponds to the maximal number of linearly independent columns of a matrix. Not sure if this is what mean by rank?

Update: Rank in linear algebra is different from the rank in deep learning.

Good discussion on overfitting: Determining when you are overfitting, underfitting, or just right?

3 Likes

if possible can you show how to package a model as a docker component. thanks

1 Like

I am unfamiliar with docker so I would not be a good resource with that, I am sorry!

1 Like