我正在尝试在Colab上创建图像数据集,但出现以下错误:
Item no.: 1 --> Item name = jaguar
Evaluating...
---------------------------------------------------------------------------
KeyError Traceback (most recent call last)
<ipython-input-15-9097d8d70946> in <module>()
19 } #creating list of arguments
20 response = google_images_download.googleimagesdownload() #class instantiation
---> 21 response.download(arguments)
2 frames
/usr/local/lib/python3.6/dist-packages/google_images_download/google_images_download.py in build_url_parameters(self, arguments)
405 for key, value in params.items():
406 if value[0] is not None:
--> 407 ext_param = value[1][value[0]]
408 # counter will tell if it is first param added or not
409 if counter == 0:
KeyError: 250000
这是我的代码:
from google_images_download import google_images_download
keyws = "jaguar"
limit = 1000
chromedriver = chromedriver_path
offset = None
color_type = None
size = 500*500
usage_rights = 'labeled-for-reuse'
arguments = {
"keywords" : keyws,
"limit" :limit,
"chromedriver":chromedriver,
"offset" : offset,
"color_type" : color_type,
"size" : size,
"usage_rights" : usage_rights
}
response = google_images_download.googleimagesdownload()
response.download(arguments)
错误指向我的response = google_images_download.googleimagesdownload()
行。我尝试查找错误,但找不到任何有关此错误的信息。这是我第一次遇到此错误,因此我真的不知道为什么我的代码会导致此错误。