Part 1 (2020) - Weekly Beginner Only Review and Q&A

I had the same problem. I changed ‘rows’ to ‘nrows’ (as it is in the book) and it solved the problem for me.

Answers/Links from last night’s group:

1. How do visualize what the convolutional kernels are learning?
This link to an updated, last year’s, notebook may help. See here. While it describes a technique to see what parts of your image your model is looking it, the ideas could be adapted perhaps into visualizing filters and also what parts of an image they are looking at (just like in the paper mentioned in class).

You may also want to search the forums as previous students may have done this already. If you get something working, put it in a notebook and post a link here! I’d love to see it.

2. What about object detection?
As you know, its not on the table for the first 7 lessons at least. But Zach Mueller has a notebook you can check out as a part of his ongoing lecture series, A Walk with fastai2.

You may also want to check out the forums to see what folks have done with adopting architectures like darknet and SSD in the past.


Along with this I recommend the part 2 from 2 years ago now where Jeremy covers it. The idea is there and then the updated code brings it together :slight_smile:


Can you please share the link?

Ganesh Bhat

Hi all,
Here are my week 3 questions:

  1. I created a tree classifier comparing two similar types of trees. They are a little too similar and model didn’t work well. I change one of the trees, updated the code throughout, and restarted the kernal. But when I run:
    fns = get_image_files(path)
    the output remains the old jpgs of trees. I’d like to know why my model’s not downloading and showing output of the new tree_type?

  2. While working on the bear model, I swapped out polar bear for teddy bear. When I ran:
    failed = verify_images(fns)
    I was getting a message that said "corrupt EXIF data…expecting 12 bytes, but only get 10 bytes. Any idea here?

  3. How often are you all doing pip installs of fastai, etc to make sure everything is up to date?

Thank you!


Hi @golz!

Great questions! What kind of trees are you aiming for? :slight_smile:

I’m not 100% sure, but did you update the paths of the changed tree?

Also, I’d recommend using some jargon here, especially since trees are a kind of classifier algorithm in ML so it sounds confusing at the first read.

Trees are your classes here (classes for the classifier) , so if you use the term classes, it makes it easier.

Could you please share the complete error stack?

It’s also useful to use backticks to nicely format it.

Once before starting my day/work with the library!

Hope this helps.
Thanks & Regards,


Just a note that we’ll be running out week 3 session in about 20 minutes for all interested (6:30 PST)

How can I pass two input type to my CNV, one is images and the other is an array of numbers?

What is a “CNV”?

Sorry, CNN

Question about the curriculum vs about this week’s lecture content specifically.

Does anyone know when Jeremy is planning to touch on Natural Language Processing?

Could we clarify what the is doing exactly?

1 Like

Did anyone try their own image classifier and get binder working for the web app? Would love a code review for the nb2 web app. I’m hitting a 404 issue with binder. Here’s my setup:

I set up a separate repo here for the app here: with the abbreviated .ipynb file, export.pkl, requirements.txt. This is what I’m putting in for binder, inserting the “/voila/render/” into the path URL.


See if this is helpful at all in thinking about a solution to passing disparate types of data (e.g images + numbers) into a model:

This was written for v.1 but the concepts should be applicable to v2.

First thing I’d do, is working on getting your datasets/dataloaders set up correctly using the low-level Datasets API or the higher-leve DataBlock API. Once you have that, I’m glad to help you structure a similar approach to that described in the article that might work pretty well for your task.

I also liked the other idea (forgot who mentioned it) about creating adding another channel to your images that described the other input … the numbers. Worth a try as well.


Can you post a message to the Official Week 3 thread w/r/t the issue with not being able to use search_bing_images?

The fastai folks will want to see the full stack trace of the error and it might be nice to also print out what versions of fastai2 and fastcore you are coding against. Don’t worry if they stack trace (the error message is gigantic) … just stick it all between two lines … each having ``` and you should be good.


Also, you may want to try this for downloading images.

This is what I’ve used in the past and its been rock solid. lmk if it works if you try it out.


I am getting ‘Access Denied’ for search_bing_images

ErrorResponseException                    Traceback (most recent call last)
<ipython-input-31-cddb73f3292e> in <module>
----> 1 results = search_images_bing(key, 'grizzly bear')
      2 ims = results.attrgot('content_url')
      3 len(ims)

/notebooks/course-v4/nbs/ in search_images_bing(key, term, min_sz)
     31 def search_images_bing(key, term, min_sz=128):
     32     client = api('', auth(key))
---> 33     return L(, count=150, min_height=min_sz, min_width=min_sz).value)

/opt/conda/envs/fastai/lib/python3.7/site-packages/azure/cognitiveservices/search/imagesearch/operations/ in search(self, query, accept_language, user_agent, client_id, client_ip, location, aspect, color, country_code, count, freshness, height, id, image_content, image_type, license, market, max_file_size, max_height, max_width, min_file_size, min_height, min_width, offset, safe_search, size, set_lang, width, custom_headers, raw, **operation_config)
    490         if response.status_code not in [200]:
--> 491             raise models.ErrorResponseException(self._deserialize, response)
    493         deserialized = None

ErrorResponseException: Operation returned an invalid status code 'Access Denied'
1 Like

My guess here is that your 7-day token expired (at least when I registered I only got access for 7 days).

1 Like

Nope, I did sign up for the services. key’s are getting authenticated

I got it to work. The only difference I see between our notebooks is I don’t pass the cpu=True or set the path=Path(). I’m skeptical that’s the reason for your troubles. Here’s my GitHub repo it has the binder link. Maybe you’ll see something I didn’t. FWIW, I fought with Binder for a little, the field where we enter /voila/render/mynb.ipynb kept going back to file instead of url. Good luck.