Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

course22 /00-is-it-a-bird-creating-a-model-from-your-own-data.ipynb - Issue #82

Open
amacaqueru opened this issue May 15, 2023 · 2 comments

Comments

@amacaqueru
Copy link

I get the following error while trying to download the forest photos


IndexError Traceback (most recent call last)
in <cell line: 1>()
----> 1 download_url(search_images('forest photos', max_images=1)[0], 'forest.jpg', show_progress=False)
2 Image.open('forest.jpg').to_thumb(256,256)

1 frames
/usr/local/lib/python3.10/dist-packages/fastcore/foundation.py in _get(self, i)
114
115 def _get(self, i):
--> 116 if is_indexer(i) or isinstance(i,slice): return getattr(self.items,'iloc',self.items)[i]
117 i = mask2idxs(i)
118 return (self.items.iloc[list(i)] if hasattr(self.items,'iloc')

IndexError: list index out of range

@altierispeixoto
Copy link

sounds the lib https://github.com/deedy5/duckduckgo_search launched a break changing and the notebook will need to be refactored.

Duckduckgo_search
Attention. Versions before v2.9.4 no longer work as of May 12, 2023!

@deedy5
Copy link

deedy5 commented May 31, 2023

I updated search_images() to match the latest version of duckduckgo_search and checked on google collab - everything is fine. PR #85

from itertools import islice
from duckduckgo_search import DDGS
from fastcore.all import *

def search_images(term, max_images=200): 
    with DDGS() as ddgs:
        return [x['image'] for x in islice(ddgs.images(term), max_images)]

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants