I’m trying to follow Jeremy’s advice and I look at the source code of some of the functions/methods appearing in this notebook. I looked at the source code of resnet34 with ??resnet34 and it all rests on some other function called ResNet. But when I do ??ResNet I obtain ``Object ResNet not found."
hey lukebyrne, Here it is some bash script that I have used to create a sample data set from a regular dataset. You can get inspired in order to build your own. You just need to shuffle and move some samples from train folder into valid folder. 20% of your examples should be in validation folder. The other folders are created/updated by fast.ai fw.
The test folder is usually used for kaggle competitions. This folder contains samples with no labels - on which you run your model, you get the predictions and you post them on the kaggle in order to get a feedback.
resnet34 is a PyTorch model imported from torchvision.models, so the class constructor ResNet you are referring to it’s not part of the fastai library.
Is it ok to use ubuntu through virtual box instead of working with windows PC? I have a PC with windows 7 and I am getting lot of errors while running fastai
When we move a tensor to the GPU with .cuda() you can set the destination (which GPU) by simply passing an integer. To use the first GPU, we should use .cuda(0). The same can be done with everything else CUDA related…
Regarding 3. - your learning rate schedule which still doesn’t work.
Both plot_lr() and plot(), are using the samples from the training dataset.
So this means that for plot_lr() you will have number_of_iterations = training_dataset_size / batch_size = 150/15 = 10. When I read your first graph I can see that you only have 5-6 iterations. You can double check the sizes by printing these print(learn.data.bs) and print(len(learn.data.trn_y))
In case of plot() method, you want to plot the learning rate against the loss. The two variables have the same length equal to the number_of_iterations. But the plot() methods cuts by default the first 10 values and the last 5 values. So if you want to use the function as it is, you will need at least 17 iterations in order to plot a 2 points line. Or you can call the function specifying to start from 0 learn.sched.plot(n_skip=0) but you will still need a minimum of 7 iterations.
Probably the best/easier would be to decrease the batch size in order to be able to display these graphs.
Hi guys,how do i resolve this issue? The directory exists, just that there is supposed to be a slash in between Fastaipics and valid, which looks something like Fastaipics/valid… Thanks!
I’m trying to reproduce the first notebook on a sample of the original dogscats dataset (around 200 pictures) by following the instructions given at the end of the notebook (section called “Review: easy steps to train a world-class image classifier”), but I’m a bit confused.
I have difficulty understanding this two times procedure corresponding to the points
Train last layer from precomputed activations for 1-2 epochs
Train last layer with data augmentation (i.e. precompute=False) for 2-3 epochs with cycle_len=1
Why is data augmentation related to precompute=False? I had the impression that these two things were independent. I thought that the precompute issue means that we have already the weights fixed for the first layers, and that the data augmentation just meant that we artificially produce more data by adding to the original pictures some modifications (rotations, croping, etc…) of them. In which way are the two related?
Why do we do 3 AND 4? Is it a way to initialize the weights to some good values (in 3) and then improve them (in 4), rather than starting with some random weights?
Sorry for my naivety, I’m really a beginner.
Thanks in advance!