Lesson 1 Discussion ✅


#1310

Hello! Does anyone know whether learn.fit_one_cycle is addititive?
Does it hold that
learn.fit_one_cycle(a)
learn.fit_one_cycle(b)
is the same as
learn.fit_one_cycle(a+b)
?
number crunching seems this to be sort off the case, but then the error rates do not seem to go down monotonously… there seems to be a little jump at the beginning of each
learn.fit_one_cycle
?? anyone knows how this works?


#1311

The data is at https://s3.amazonaws.com/fast-ai-imageclas/oxford-iiit-pet.tgz, their interface is just a bit weird (the .tgz was added in the function itself…)

The network connection part in kaggle kernel also trips me over though, even though I turned on the internet connection it still didn’t work (ended up using colab instead)


(Piotr Olchawa) #1312

Yeah, it was the same for me, I also switched to Colab. Thanks for help!


(Vikrant Behal) #1313

How can I untar data into my google collab?

How do I change?

path = untar_data(URLs.PETS); path

Per documenation I’ve done following:

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

and made directory using:

path = Path(base_dir + ‘data’)
folder = ‘lesson1_pets’
dest = path/folder
path.mkdir(parents=True, exist_ok=True)


#1314

i just watched the lecture and tried the code simultaniously on my local pc. apart from some minor hick ups it worked great. while doing the training parts, i was looking at my cpu and gpu load and it was actually pretty much idle for most of the time, with minor spikes for the cpu (up to 100%) and gpu (highest about 20%, although the memory got utilized about 50%), is that normal or do i have something configured wrong.

i was expecting the gpu to do most of the work and also why is there so much downtime?
i havent timed that but from my feeling; after hitting shirt+enter to execute the line until it was done, the cpu/gpu was more idle than doing something.

greetings from austria


#1315

Simple question:

After building a convnet and applying learn.fit_one_cycle(4), prior to any fine-tuning, what’s the learning rate used by default? Is it a default constant or does it try to pick an appropriate value?


(kelvin chan) #1316

I have yet to read the code in details. But I used to see this in Keras if you “recompiled” your model after each .fit. If I transfer the knowledge from there, I speculate it maybe due to optimizer statefulness. Optimizers such as Adams and batchnorm layers track histories (e.g. exp avg of the gradients). If these aren’t kept inbetween .fit, then u will see that behavior.

Again, I ain’t fastai codebase expert and I wait for better folks to give Insights.


(Taher Ali) #1317

hi raimanu-ds have you find solution for this .


#1318

No I haven’t. I would be interested to know how though ^^

The only ways I was able to load other datasets so far were through uploads using Colab’s GUI, CLI commands in Colab or Kaggle’s API and feed it through ImageDataBunch.from_folder().


(Taher Ali) #1319

Please write it here . if you find solution for this


#1320

I found on this forum you should change the regular expression pattern to something else if you are on windows:
pat = re.compile(r’\([^\]+)_\d+.jpg$’)
this works for me!


(David) #1321

The fit_one_cycle function uses a max learning rate: max_lr(): the default value is 0.003 (or 3e-03).
Check the docs for more info.


(Agatha) #1322

I’m actually not really sure what this error is or if the output below the warning(?)/error(?) message is the one-preloaded with the notebook, or the actual one I’m running right now.

I don’t really get why the ‘lower’ attribute had an error, that just lowercases the what I assume is a string right for ‘front_end’? Has anybody reported on this bug before?

*As an added note, I’m running on my own machine running Ubuntu 18.04, and I followed the installation instructions for AWS.


(Osam) #1323

I unfroze the model and “trained more layers” but used 4 epochs instead of 1. The model came out more accurate. The time lost in training was about 15 secs.


#1324

Hi all,

I am running the jupyter notebook on my own computer. After running the learn.fit_one_cycle(4) part of the code, the next cell next (learn.load(‘stage-1’) does not run properly. It kind of gets stuck. I can not interrupt my kernel anymore, the only solution is to restart it, but then I also lose all of my data. Does anyone have an idea how I can fix this?

I am using Jupyter notebook 5.7.4, python version 3.7.1, fastai 1.0.38 and pytorch 1.0.0.

~ Sophie


(chandan ) #1325

check if you have imported the fastai library properly


(Parth ) #1327

I do not know if this is the right place to ask this question. After implementing this lecture, I wonder how would I go on to train a classifier with multiple classes which can detect all of those classes if given in a single image for prediction? I have seen somewhere those bounding boxes which detect multiple classes in a single image. Is it a completely different task or this tutorial can be extended to do something like that?


#1328

Hi :wave:t3:,
You will learn more about this in Lesson 3 :wink:


(Parth ) #1329

Thanks for reply. I have actually seen that lecture. There Jeremy discusses about multi-label classification. I was asking - for example, if I have trained my model to classify 10 celebrities and if I give a group photo or something like that does model can identify different celebrities in it(with where the person is)? How would that generally work?


#1330

I have just started with the first lesson of DL part 1. I would be interested in DL applications for de novo design.