Wiki: Lesson 1

When you say “Train” your own model - how do we do this? Is there a setting to “not use the pretrained model”?

Anybody knows where the data folder is in here https://github.com/fastai/fastai/tree/master/courses/dl1?
I am not able to run the examples.

I’ve been trying to run lesson1-rxt50.ipynb on my own hardware, a i7-6700K box, with 16GB of memory and an GTX1070 graphics card. I’m running Fedora Linux 27. I have installed CUDA-9, the latest version of CudNN and installed PyTorch from git. To run the notebook on my CPU I had to reduce the batch size, and then the network fitted inside the 8GB of GPU memory. When running the network, the irst few steps of the work fine, and I can see the improvement of the error rate. But, while the network is running, my CPU (not GPU) memory is constantly increasing. In the last learning step, when the whole network is unfrozen, and we try to learn by three different learning rates, the virtual memory of the process reaches more than 50GB, and eventually the system freezes, and needs to be rebooted.

Does anyone know whether this is “normal” and should I just buy more RAM, a configuration issue, or is this a memory leak in pytorch?

Sorry, for confusion. I mean training our own data. So far I do not know about fastai library documentation.

Hi @vikasbahirwani,
sorry for the delay.
Yes, you got the point about precomputed activations.
Concerning the pretrained weights w, it is also correct.

1 Like

This models folder is where are located models that you saved using:
learn.save('my_model_name')
So if you don’t run the above instruction you won’t see anything there.
And also when you call:
learn.load('my_model_name')
The load method looks for the your ‘my_model_name’ model in the “models” folder.

Pretrained models are located elsewhere.
This is a nice default that comes up the Fastai library, every model trained on a specific data set is saved by default in a subfolder of the data folder named models.

It’s a great exercise that allows you to go through all the steps from finding data, cleaning them, organize them and finally train them.
Concerning the number, you must experiment but always start small and increase.
About overfitting, it depends you figure out whether it is overfitting or underfitting or good by looking at the different losses.
Also it’s a good idea to experiment different architecture: resnext50, denset, …

1 Like

Thank you. I am glad you helped. I was stuck mentally and could not move forward without closure.

Excellent input. This makes more sense.

Quick follow up: Do you know where the ‘pretrained’ models are located. and is there a way to not use pretrained weights (just to experiment)

You have a typo. It is used to get stat about GPU, not the CPU.

In the original paper the authors train on multiple epochs with learning rate varying linearly from low to high. And, they train on train data and in the plot (validation accuracy vs learning rate) they calculate accuracy on the validation data.

You are asking to return M numbers (say 30) out of m numbers (say 20) without replacement (i.e. only unique ones), which is not possible unless you allow duplicates.

hi . I am getting this error again and again
error: /io/opencv/modules/imgproc/src/color.cpp:11079: error: (-215) scn == 3 || scn == 4 in function cvtColor
what does it mean and how can I solve it

Can you be a little more specific? What line of code causes the error? I believe you are trying to convert color spaces (RGB to Gray I imagine), and the image you’re passing in is incorrect.

1 Like

actually I am trying to run the lesson-2_image_model.ipynb using colaboratory but I am getting this error when I am running the code
lrf = learn.lr_find()
and also after ths line of code I am getting the same error in all the other lines of code after it.

Has anyone tried to create paperspace machine from Tokyo Japan saw the error message of no available public IP from your region from the Website?
Please let me know how you dealt with the problem.
many thanks!!

For getting started with " colaboratory and fastai " you can follow this blog as I have successfully done this.
[http://theailearner.com/2018/03/10/free-gpu-for-fast-ai-on-google-colab/]

1 Like

Did you set up fastai on collab correctly? And did you create a data folder for keeping images?
And do share your code, will you?

Were you able to get past this? I’m stuck with the same error.