Hey peeps, i’ve been bashing my head against the wall for an hour now. I’m trying to run a cell on the google colab lesson #2, specifically:
bear_types = 'grizzly','black','teddy'
path = Path('bears')
if not path.exists():
path.mkdir()
for o in bear_types:
dest = (path/o)
dest.mkdir(exist_ok=True)
results = search_images_bing(key, f'{o} bear')
download_images(dest, urls=results.attrgot('content_url'))
but i am getting the following error:
---------------------------------------------------------------------------
TypeError Traceback (most recent call last)
<ipython-input-5-f86506dc644b> in <module>()
5 dest.mkdir(exist_ok=True)
6 results = search_images_bing(key, f'{o} bear')
----> 7 download_images(dest, urls=results.attrgot('content_url'))
2 frames
/usr/local/lib/python3.6/dist-packages/fastai/vision/utils.py in download_images(dest, url_file, urls, max_pics, n_workers, timeout)
22 dest = Path(dest)
23 dest.mkdir(exist_ok=True)
---> 24 parallel(partial(_download_image_inner, dest, timeout=timeout), list(enumerate(urls)), n_workers=n_workers)
25
26 # Cell
/usr/local/lib/python3.6/dist-packages/fastcore/utils.py in parallel(f, items, n_workers, total, progress, pause, timeout, chunksize, *args, **kwargs)
704 "Applies `func` in parallel to `items`, using `n_workers`"
705 if progress is None: progress = progress_bar is not None
--> 706 with ProcessPoolExecutor(n_workers, pause=pause) as ex:
707 r = ex.map(f,items, *args, timeout=timeout, chunksize=chunksize, **kwargs)
708 if progress:
/usr/local/lib/python3.6/dist-packages/fastcore/utils.py in __init__(self, max_workers, on_exc, pause, mp_context, initializer, initargs)
685 self.not_parallel = max_workers==0
686 if self.not_parallel: max_workers=1
--> 687 super().__init__(max_workers, mp_context=mp_context, initializer=initializer, initargs=initargs)
688
689 def map(self, f, items, timeout=None, chunksize=1, *args, **kwargs):
TypeError: __init__() got an unexpected keyword argument 'mp_context'
Can anyone tell me where i’ve gone wrong?