02_production PermissionDenied Error

Many thanks all for helping resolve this - I’ve checked and the latest version of fastbook now runs correctly.

If anyone is interested in writing a more detailed step-by-step tutorial on how to subscribe to Bing Search v7 and key the correct API key, please do (and let me know about it), since I’d love to link to such a thing from course.fast.ai.

4 Likes

I have changed from ‘content_url’ to ‘contentUrl’ just like your suggestion and It works. Thank you!

Hey Jeremy, as a small thank you I created a tutorial on how to subscribe to Bing Search and insert the correct API key. Here is a link to a google drive folder containing the presentation and a PDF copy. Feel free to make any changes and to distribute as you see fit.

(I would have labeled Step 4 as ‘Insert Coins to Continue’ but decided to keep it professional)

Hope this helps,
Cullen

1 Like

I keep getting this error after running the following code:

def search_images_bing(key, term, min_sz=128, max_images=150):    
     params = {'q':term, 'count':max_images, 'min_height':min_sz, 'min_width':min_sz}
     headers = {"Ocp-Apim-Subscription-Key":key}
     search_url = "https://api.bing.microsoft.com/v7.0/images/search"
     response = requests.get(search_url, headers=headers, params=params)
     response.raise_for_status()
     search_results = response.json()    
     return L(search_results['value'])

I think it is grabbing the wrong url’s. Can someone help me resolve this issue?

I don’t see a lot of different from my working code:

def search_images_bing(key, term, max_images: int = 150, **kwargs):    
         params = {'q':term, 'count':max_images}
         headers = {"Ocp-Apim-Subscription-Key":key}
         search_url = "https://api.bing.microsoft.com/v7.0/images/search"
         response = requests.get(search_url, headers=headers, params=params)
         response.raise_for_status()
         search_results = response.json()    
         return L(search_results['value'])

Thanks for all the work Jeremy.

If I run a fresh paper space instance and “git pull”, this still doesn’t work.

Do you have the github link of this working in a notebook?

You’re right, it is not much different at all, just packaged into a function that is easier for some people to call. But couldn’t have done it without your great solution :slight_smile:

Using following guideline I was able to generate a valid azure search key:

Thanks! It worked for me.

I still am having this same issue with no images saved in my path folder. Is there something else I need to do other than change ‘content_url’ to ‘contentUrl’ ? I can see that the function search_images_bing is indeed getting image urls, but saving the images in the path folder is not working

Hi NathanSepulveda hope all is well!

If you run this command !ls -al after line 27, what do you get?
Which statement is failing or not running?
Do the paths actually exist?

I don’t use this download_images() for downloading images.
but If I had this problem I would confirm which line of the code in 26 is causing the issue.

hints:
try moving the for loop to the left so it is not in the if condition.
try running each line individually and check if its doing what you expect.

Hope this helps.
Cheers mrfabulous1 :smiley: :smiley:

This has become borderline unusable. I am deeply disappointed that such a promising product has such glaring issues. It reflects poorly on the authors that there is no mainline update on this issue.

Thanks. This worked for me too :slight_smile:

Consider that every single piece of software you are using here, from the fastai package to the course to the book to the notebook servers and microsoft bing search, and even this Q&A framework is given to you absolutely free. Software engineering is about solving problems and working with people. Have a little humility please.

1 Like

I ran into this same issue today (Aug 9, 2021). It turns out that the Gradient server has fastbook==0.0.14 installed by default. The latest is 0.0.16 but in the course Gradient setup instructions, it only says pip install fastai fastcore --upgrade and doesn’t include fastbook. I opened a terminal and ran pip install --upgrade fastbook==0.0.16 and then this problem was resolved.

search_images_bing is not working.