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

search_images_ddg(key,max_n=200) #362

Open
prairie-guy opened this issue Dec 20, 2020 · 4 comments
Open

search_images_ddg(key,max_n=200) #362

prairie-guy opened this issue Dec 20, 2020 · 4 comments

Comments

@prairie-guy
Copy link
Contributor

As author of the function search_images_ddg (key,max_n=200), I have gotten several complaints of it not working. The function in the github repositoryutils.py/search_images_ddg works as expected.

The problem is with the pip package version, fastbook-0.0.16.tar.gz https://pypi.org/project/fastbook/#modal-close, where the file: __init__.py overwrites and breaks the working version of search_images_ddg

Could the author of the pip package update it with working code from github, or else fix the the pip package version of the function and then update the github repository so there is only one version of the function?

Thanks

@AndrewDettor
Copy link

AndrewDettor commented Feb 5, 2021

Hi prairie-guy,

What exactly wasn't working with search_images_ddg?

I was having an issue where urls = search_images_ddg('dogs', max_images=200) would give

AttributeError: 'str' object has no attribute 'decode'

on the line 57 of fastbook/__init__.py : res = urlread(url,data={'q':term}).decode().

I got around the issue by pasting the fixed function currently in utils.py into a code cell.

@prairie-guy
Copy link
Contributor Author

As you point out, the fastbook github code (which I originally submitted ) works. The problem is with the version of the function called by: pip install fastbook That version of search_images_ddg has been modified and doesn’t work. I’m not sure how to update the pip version.

@prairie-guy
Copy link
Contributor Author

prairie-guy commented May 30, 2021

I wrote the pull request for search_images_ddg used in the fastbook github repo. It works as expected. The pip repository of fastbook has an error. There are several mentions of this problem in the Isssues of this repo. Moreover, the fastai forum has multiple mentions of it. Finally, as the Practical Deep Learning for Coders course starts with a description of search_images_ddg I would like this function to work correctly. I would update the pip repo myself, but I don’t know how. Can someone please fix the pip fastbook repo?

@albertyw
Copy link

albertyw commented Jun 1, 2021

I'd also note that the course uses search_images_ddg with a max_images flag whereas prairie-guy's code uses max_n. If a new release is made using @prairie-guy's code, the course will also need to update its documentation to use the correct flag.

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