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

@mgloria so if we look at MNIST, we can do:

splitter= RandomSplitter(0.1)
splits = splitter(items)

Where items is our get_image_files. Hopefully that’s a hint, best I can look at right now

I tried to be a bit sneaky to pass the paths in an L() but not even like this still TypeError: 'TransformBlock' object is not callable seems like this RandomSplitter is never happy! :pensive: I will consult it with my pillow

1 Like

I’ll take a look at it in a bit @mgloria :slight_smile: no worries

OH! @mgloria you’re using CategoryBlock! This is meant for the DataBlock. You should be using Categorize()! (or MultiCategorize if it’s multiple categories at one time)

Running the segmentation nb and when I try to create the unet learner:
learn = unet_learner(dls, resnet34, metrics=acc_camvid, config=config, opt_func=opt)

I encounter a HTTP Error
HTTPError: HTTP Error 403: Forbidden

Any thoughts WHY?? Anybody else have this problem.

The stack dump is LONG - so I have not pasted it in - but seems to be having difficulty downloading the resnet34 model.

Can provide stack dump if that will help.

@Srinivas it’s because you can’t download the pretrained model wherever you are at or it could be something on Colab’s side. I’m unsure. Wasn’t sure if it was an isolated incident. See here and my post below it:

I had the same issue earlier

Thanks for the quick response - I did try a couple of times.
I will try what you suggest.

Awesome! Brilliant that you realized about this details @muellerzr. Should we maybe add this information in the power point? Maybe just the link to the documentation. I was using the power as a reference but the transforms listed are just for Datablock api. This can be maybe a bit confusing since the difference between the two can be easily overlooked.

It looks to me now the first part is working.
Interestingly, it works now also with the dataframe -> much easier, no need to pass and L() with the paths
The error I am getting in the dataloaders is RuntimeError: "uniform_cuda" not implemented for 'Byte'


@mgloria try setting CUDA to true on your dataloader otherwise I’m not sure. I’ve never seen that before.

Thanks again.
I had to manually create the /torch/checkpoints dirs under /root/.cache which already existed.
Then use the commands provided to copy down the model
I am able to proceed now.

FYI for others using colab.

1 Like

Here’s the link for our lesson tonight:


To answer your question (why do I use nbviewer and sometimes colab) @mike.moloch I do notebook viewer as I don’t have the time to run them beforehand. If it’s a quick model to train or do I’ll do it live. Else it’ll be done before hand.

nbviewer is a static site for reading jupyter notebooks so there’s no interaction etc there

1 Like

Sorry guys, had an issue on my end. I’ll record a lecture and release it later this week, hopefully tommorow.


Ah ok! Thanks!

how to export part of the model as .pth, like exporting encoder of Autoencoder/Unet ?

Is anyone else having an issue using MishJit as the activation in Segmentation ? Mish works fine.

I guess it has been renamed to Mish. If you look at the source code of fastai2, internally it’s calling MishJit only:

class Mish(Module):
    def forward(self, x): return MishJitAutoFn.apply(x)

ah yes you are correct. changed as fastai2 0.0.8 has been released :slight_smile:

I’ve fixed the notebook links, and adjusted any calls to MishJit

1 Like

A few questions about the learning rate in Segmentation:
1)after calling .lr_find we get back two values when Suggestions=True which are lr_min, lr_steep .
Here(see fig) we are getting - (0.2754228591918945, 0.3019951581954956). any suggestions on how we use these numbers returned to set lr?
2)In Segmentation when we call fit the first time why are we passing in slice(lr)?
Since the model is frozen we are trying to train the decoder part only,
slice(1e-3) = slice(None, 0.001, None) =>
does the first None correspond to lr for the frozen resnet body(we don’t want to train the encoder)?
What do the last None and 0.001 correspond to ?
similarly after we call unfreeze we pass in
slice(1e-5,1e-3) = slice(1e-05, 0.001, None) =>
here the 1e-5 is for the encoder?
what is 0.001 and None used for? the decoder?