Lesson 1 In-Class Discussion ✅

hi Ste,

thanks, so this is for random initiating wgts for convlearner, correct? has nothing to do with the databunch?


No, I ran:

source activate fastai
conda update fastai

which is what’s shown in Returning to Salamander -

conda list doesn’t show fastai at all… odd

I’m trying to fit a model on the fish species dataset. But it only has a train folder with the images organized into subfolders.
How do I automatically create a validation set using some of the training images.
Is it possible with ImageDataBunch?

@lesscomfortable I get fastai version : 1.0.11 using Jeremy’s method

@kofi you can use the same method from_folder in ImageDataBunch but give .20 for valid_pct. I hope it helps.

OK, then I ran what you suggested:
conda install -c fastai fastai

and now conda list shows fastai at 1.0.15, which seems promising - but then when I run

import fastai

it still shows 1.0.11.

I’m a complete noob with ubuntu, but I’m starting to get what’s going on… the new fastai is now installed in the anaconda3 folder - but my notebook is seeing the old fastai… The update method shown on the Returning to Salamander page isn’t actually updating fastai:

source activate fastai
conda update fastai

and the fastai in anaconda3 isn’t visible to my Salamander notebooks.

So I’m stuck again!

No it doesn’t, I’m getting an error

Warning to others: I stopped getting email notifications from this forum a couple of days ago, even though I hadn’t changed the Tracking status, so I wasn’t seeing replies to my posts. Has anyone else noticed this?

I got it working after updating fastai, thank you very much pal.

One other question, do we run lr_find() before unfreeze() or after

1 Like

Thanks a lot @hiromi too. And they keep getting better with every course


@kofi yes we need to run lr_unfreeze() twice and lr_find() in between these unfreeze() calls. The 1st unfreeze tells us how much the resnet weights were helpful for this dataset classification and later lr_find helps in finding the best lr and we use the same with our again unfreezed model. I hope this helps :). (Sorry for late reply).

hey, nevermind. I saw the imagedatabunch does random split for training/test ds. That make sense now.

thanks! :slight_smile:

Hey, I’m sorry about that. Could you try with:

pip install fastai --upgrade

Please let me know if it works.

1 Like

Thank you @brismith. Ran “conda install nb_conda_kernels” and “conda install ipykernel” and I can see all the kernels.

1 Like

Can anyone please help me in enabling the nbextensions for Jupyter notebook in GCP setup? Using this I think Gist and HTML page creations will be really easy.

Thanks Francisco. I ran that; the first line returned was:
Requirement already up-to-date: fastai in /home/ubuntu/anaconda3/lib/python3.6/site-packages (1.0.15)

…which tells me it’s still working in the anaconda3 folder, which the Salamander nb’s don’t seem to looking in for fastai. And fastai.show_install(0) in the nb still shows 1.0.11

Support for more deeper models? Which model is proven to work (deeper than ResNet50) for large scale image classification (approx. 35M ) images ? I was thinking of ResNext or Inception but haven’t much played around with them.

@mayanksatnalika while it is true that an unfreezed model has more parameters to train than a freezed model, number of parameters in the last fully connected layers is very high compared to early layers(unfreezed part). So the difference in the parameters comparitively might not be that high when FC layers are thrown in the mix. So this might be a reason for less traintime difference

1 Like

I’ve NVIDIA driver 398.26 and I’m on windows.

On running conda install -c pytorch pytorch-nightly cuda92 throws following error :

PackagesNotFoundError: The following packages are not available from current channels:

  - pytorch-nightly

  - https://conda.anaconda.org/pytorch/win-64
  - https://conda.anaconda.org/pytorch/noarch
  - https://repo.anaconda.com/pkgs/main/win-64
  - https://repo.anaconda.com/pkgs/main/noarch
  - https://repo.anaconda.com/pkgs/free/win-64
  - https://repo.anaconda.com/pkgs/free/noarch
  - https://repo.anaconda.com/pkgs/r/win-64
  - https://repo.anaconda.com/pkgs/r/noarch
  - https://repo.anaconda.com/pkgs/pro/win-64
  - https://repo.anaconda.com/pkgs/pro/noarch
  - https://repo.anaconda.com/pkgs/msys2/win-64
  - https://repo.anaconda.com/pkgs/msys2/noarch

Also running pip install torch_nightly -f https://download.pytorch.org/whl/nightly/cu92/torch_nightly.html
throws error :

Collecting torch_nightly
  Could not find a version that satisfies the requirement torch_nightly (from versions: )
No matching distribution found for torch_nightly

By pure intuition, I can see why it is easy to tell a grizzly and polar bear apart: one is black and another is white. Another potential reason might be the fact that ImageNet is trained with animal and even bear image categories, so Resnet is already good at these categories.