📝 Deep Learning Lesson 1 Notes

(Matthew Arthur) #43

Hi @bandiatindra this is an extension of the learner class to apply the 1cycle approach. Here are two links:

https://docs.fast.ai/callbacks.one_cycle.html

0 Likes

(Ravitha Rajalakshmi) #44

When i used learn.unfreeze() I find no changes in the model summary. The trainable parameter of convolution base is still set to False. Isn’t unfreeze used to fine tune the convolution base?

1 Like

(Leo) #45

Xmind Zen

0 Likes

(深度碎片) #46

如何使用Colab


这是fast.ai v3 课程使用Colab的快速入门指南

如何你不是第一次使用,请参看returning to work 指南

注意: 这是免费服务但不是随时都提供,而且你需要额外工作保存你的实验。务必仔细阅读colab说明理解服务的局限性.

Step 1: Accessing Colab

  1. 首先,登陆谷歌账户here.

  2. 然后, 前往 Colab Welcome Page 并点击 ‘Github’. 在 ‘Enter a GitHub URL or search by organization or user’ 一栏填写 ‘fastai/course-v3’. 你将看到所有课程notebooks,点击一个你感兴趣的.

  1. 在你运行前,需要告知Colab你希望使用GPU. 你可以点击 ‘Runtime’ tab 选择 ‘Change runtime type’. 在随后打开的窗口下拉菜单里选择‘GPU’,或者在edit中选择Notebook settings中选择GPU 然后点击 ‘Save’.

Step 2: Configuring your notebook instance

  1. 在你开始使用notebook前, 你需要安装必须的软件包。你可以用以下代码,运行第一个Cell
!pip install numpy==1.15
# then restart the runtime, open a new cell to run the following
!curl -s https://course.fast.ai/setup/colab | bash

  1. 然后,你会看到一个跳出窗口说 ‘Warning: This notebook was not authored by Google’; 你选中’Reset all runtimes before running’, 然后点击‘Run Anyway’.

  1. 在新窗口中点击 ‘Yes’.

Step 3: Saving your notebook

如果你是从github打开notebook,你需要将实验存入Google Drive. 你可以点击 ‘File’ 再点击 ‘Save’. 你可以看到以下窗口,然后点击‘SAVE A COPY IN DRIVE’


这将打开一个新 tab 含有相同文件位于你的Google Drive. 如果你希望保存后继续工作,那么直接在这个新tab中工作就可以. 你的notebook将被保存在一个叫 Colab Notebooks的文件夹位于你的Google Drive中.

Step 4: Saving your data files

如果你希望改写你的文件,你需要允许你的Colaboratory instance读取和改写你的 Google Drive. 你只需要在每一个notebook的第一个Cell中写入以下代码

from google.colab import drive
drive.mount('/content/gdrive', force_remount=True)
root_dir = "/content/gdrive/My Drive/"
base_dir = root_dir + 'fastai-v3/'

现在,你的 Google Drive 变成了一个文件系统允许标准python读写文件. 不要忘记给所有notebook的根目录地址前加上 base_dir . 例如, 在 lesson2-download.ipynb 5th cell, 做一下修改

path = Path(base_dir + 'data/bears')
dest = path/folder
dest.mkdir(parents=True, exist_ok=True)

More help

更多问题可以在 fast.ai forum 提出。

Colab

0 Likes

(Marijan Milovec) #47

I have a problem on google cloud instance I cannot do git pull it say permission denied, not sure why, I am owner of the project and still not working. How to setup git on google cloud instance right so that it works and so that I can do git pull.
Thank you

0 Likes

(Akshai Rajendran) #49

Marijan, where are you calling git pull from? It works fine for me after changing into this directory:

cd tutorials/fastai/course-v3

Can you confirm that you are calling this from your fastai instance and not locally? (Do you see

jupyter@my-fastai-instance:

in your terminal?)

0 Likes

(Marijan Milovec) #50

yes I can confirm that I am in cd tutorials/fastai/course-v3 and I can see jupyter@my-fastai-instance:

but when I go git pull it said permission denied.

0 Likes

(SHARAN VISHNU S) #51

@PoonamV Does that give me the freedom to first give the dimensions as 224 x 224 , find the learning rate corresponding to that from learn.lr_find() and then unfreeze the layers , change the dimension back again to whatever I want and then train the unfreezed layers? Because I feel that when the dimensions are reduced, a lot of information goes missing which may be very crucial for certain specific classifications…

1 Like

(rkirana) #53

Very nicely done. Which tool did you use for the mindmap?

0 Likes

(bintao li) #54

@leovcld, great job!!
I wonder whether you have also done mindmaps to the rest lesson 2-7!
If yes, could we share them too? thanks.

0 Likes

(Sara EL-ATEIF) #55

Thank you so much.

0 Likes

#56

Very helpful. Thanks!!

0 Likes

#57

Two things:

  1. create_cnn is now deprecated.
    learn = create_cnn(data, models.resnet34, metrics=error_rate)
    should now be
    learn = cnn_learner(data, models.resnet34, metrics=error_rate)

  2. doc(interp.plot_top_losses) throws an error.

1 Like

(Salim) #58

My lesson 1 notes with some added clarifications. Hope some will find it helpful.

0 Likes