The Bing Image Search key WRONG!

I have a bing image serach key,run python code can run. but use key to lesson2 is ‘PermissionDenied’

Hi @salvager ,

I am using a library for Bing search that does not require a key, you may want to try it out.

Hope it helps !
Charles

Great! THANKS!

perfect! That’s great!

@nn.Charles, I have the same issue but your solution doesn’t work for me. Any idea?

File “”, line 2
pip install bing-image-downloader
^
SyntaxError: invalid syntax

!pip install bing-image-downloader

i use colab

Have problem!
dls.valid.show current!
dls.train.show_batch show wrong! ValueError: This DataLoader does not contain any batches

I just managed to install the image downloader but now I get the error:

----> 3 downloader.download(q, limit=20, output_dir=‘bears’, adult_filter_off=True, force_replace=False, timeout=5)

NameError: name ‘downloader’ is not defined

Try this :slight_smile:
from bing_image_downloader import downloader

Can you please show the DataBlock (bears) definition ?

I got it to work, thanks Charles

1 Like

NameError: name ‘downloader’ is not defined

code add: from bing_image_downloader import downloader

bears = DataBlock(

blocks=(ImageBlock, CategoryBlock), 

get_items=get_image_files, 

splitter=RandomSplitter(valid_pct=0.2, seed=20),

get_y=parent_label,

item_tfms=Resize(128))

I solution dls.train.show_batch error

add batch_size in code dataloaders!