-1
download_images(path/file, dest, max_pics=400)


---------------------------------------------------------------------------
IsADirectoryError                         Traceback (most recent call last)
<ipython-input-16-fd768bad6ac9> in <module>()
      1 #3
----> 2 download_images(path/file, dest, max_pics=400)

2 frames
/usr/lib/python3.6/pathlib.py in open(self, mode, buffering, encoding, errors, newline)
   1181             self._raise_closed()
   1182         return io.open(str(self), mode, buffering, encoding, errors, newline,
-> 1183                        opener=self._opener)
   1184 
   1185     def read_bytes(self):

IsADirectoryError: [Errno 21] Is a directory: 'data/marvel/thor'
Pranav Hosangadi
  • 23,755
  • 7
  • 44
  • 70
  • Does this answer your question? [“IsADirectoryError: \[Errno 21\] Is a directory: ” It is a file](https://stackoverflow.com/questions/52338706/isadirectoryerror-errno-21-is-a-directory-it-is-a-file) – Pranav Hosangadi Oct 06 '20 at 21:48

1 Answers1

0

If data/marvel/thor is a directory, please try follows.

import os
data_paths = [os.path.join(pth, f) for pth, dirs, files in os.walk('data/marverl/thor') for f in files]
data = [download_images(f, mmap_mode='r') for f in data_paths]

You need to provide a variable/place to store each image separately.

Kate Melnykova
  • 1,863
  • 1
  • 5
  • 17