Wiki: Lesson 1

I added a link in the original post above. Here you go: http://bit.ly/2o4Sgjh

I’ve written a few basic scripts that help with the workflow for setting up problems similar to Cats and Dogs. Deep Learning Utilities

There are three simple scripts: image_download.py, make_train_valid.py and filter_img.py I developed these tools because I wanted to very simply experiment with the Lesson 1 image classifier on a variety of different datasets.

Here is a sample work flow:

image_download.py 'bmw' 500 --engine 'bing' --gui
image_download.py 'cadillac' 500 --engine 'google'
mv dataset cars
filter_img.py cars/bmw
filter_img.py cars/cadillac
make_train_valid.py cars --train .75 --valid .25

I’ve used these on a variety of training exercises. All I need to do is change the path in Lesson1.ipynb and it’s very straight-forward to try out new sets of images.

I’ve added these to GitHub. Please feel free to clone and use. If anyone has questions or feedback, please feel free to let me know.

11 Likes

I use the Google cloud platform to run the jupyter notebook. However, i often face one problem.
The Kernel is always restarting. The error message is “The kernel appears to have died. It will restart automatically.”

Is there something wrong with my GCP set? I wonder if I ran out of memory.

Hi, I discovered the ML course kind of by accident here. A previous question’s answer implies that it’s okay for us lay public people to watch it, that you won’t get in trouble if I do BUT the lecture says to watch it on course.fast.ai and not on YouTube for reasons which were highly unclear. However, I can’t find those lessons on course.fast.ai.

Should I be waiting until they are up on course.fast.ai or is it okay to watch them on YouTube?

Hi Kaitlin,

Here is the link for Deep Learning Part 1 lessons at fast.ai.

http://course.fast.ai/lessons/lessons.html

It’s ok to watch them on YouTube until the videos are posted to the website (possibly later with some edits)
machine learning videos

1 Like

Hi, I am signed into Colaboratory with my gmail account. I loaded the Fastai lesson1 notebook and saved it to my Google Drive. But I can not run any of the cells in the notebook.

I click File > Open recent, and the notebook is loaded from Google Drive.

When I try to run any of the cells in the notebook I get the message:

Running read-only notebooks is not supported.

How can I run the notebook cells?

Thanks

Hi Hwang,
I am running GCE too, and although there may be some weirdness around GCE (google compute engine) the errors, the most common error I have is the GPU running out of memory. You can lower memory by manually lowering the batch size bs in the ConvLearner constructor.

Hi How can I enable multiple GPUs on fastai?

Hello,
Is it just me or is Paperspace now requiring security clearance even on the lowest machine after selecting Public Templates. Actually the security block comes on right after selecting Public Templates. This is my 2nd day of waiting for clearance and I am eager to get started. Perhaps they have more customers than they can handle. What are they worried about? North Korean hackers?

I reached the end of the Lesson 1 video, but it stopped at the “Improving our model” section of the Jupyter notebook. Will the rest of the notebook be covered in a later video, or are we supposed to explore the rest of the notebook ourselves?

Encountered the same Paperspace problem, been days and I still can not have access to create even an Ubuntu instance! How long do you guys need to wait to be approved?

Is there a good alternative to Paperspace?

Hello,

I found out from the first lesson that I have to configure web services like ‘paperspace’. But, I have a laptop with GTX1050, is it not possible to configure this GPU itself and run the programs??

Please help me understand this.

Thank you!
Anil

It’s obviously possible with a 1050…

1 Like

I came across the same issue last week when I was trying to set up my machine. I waited about 3 days before I sent a support ticket and they approved my request within 24 hours after.

I am using Google Cloud Computing, I get 300$ credit free when register. I follow this guide https://medium.com/@howkhang/ultimate-guide-to-setting-up-a-google-cloud-machine-for-fast-ai-version-2-f374208be43 for setup. It take 2-3 days for the step increasing GPU quotas. Everything works fine.

1 Like

As long as your GPU has CUDA 3.0 you’re good to go. I has GTX 745 but still works fine.

1 Like

Hi, I had run the lesson 1 notebook earlier on Google Colab without any issue. However yesterday when I tried to re-run it, facing below error.
AxisError: axis 1 is out of bounds for array of dimension 1

The notebook is same as what @manikanta_s put up in this post here

Step: Fine-tuning and differential learning rate annealing
Code:

log_preds,y = learn.TTA()
probs = np.mean(np.exp(log_preds),0)
accuracy(probs, y) <<<<< Error in this line

Error:
---------------------------------------------------------------------------
AxisError Traceback (most recent call last)
in ()
----> 1 accuracy(probs, y)

/usr/local/lib/python3.6/dist-packages/fastai/metrics.py in accuracy(preds, targs)
      3 
      4 def accuracy(preds, targs):
----> 5     preds = np.argmax(preds, axis=1)
      6     return (preds==targs).mean()
      7 

/usr/local/lib/python3.6/dist-packages/numpy/core/fromnumeric.py in argmax(a, axis, out)
   1002 
   1003     """
-> 1004     return _wrapfunc(a, 'argmax', axis=axis, out=out)
   1005 
   1006 

/usr/local/lib/python3.6/dist-packages/numpy/core/fromnumeric.py in _wrapfunc(obj, method, *args, **kwds)
     50 def _wrapfunc(obj, method, *args, **kwds):
     51     try:
---> 52         return getattr(obj, method)(*args, **kwds)
     53 
     54     # An AttributeError occurs if the object does not have

AxisError: axis 1 is out of bounds for array of dimension 1

Any idea why I am getting this error now?

-Thanks
Nikhil

1 Like

Well, looks like ‘log_preds’ should be used instead of ‘probs’. Is this a recent change in the accuracy function? Thanks.

1 Like

Hi,

Thanks for the reply!
I am new to these GPU configurations. Could you please clarify my below thoughts.

  1. We use WEB services for training when one does not have a GPU in his\her PC.
  2. If the appropriate GPU is available in PC, we do not need to use any WEB services. Right? We just have to configure the GPU available on PC for training.

If my understanding is correct, how do I configure GPU on my laptop for trainin g?

Thank you!
Anil