jakartaresearch / earth-vision

Jakarta Research Earth Observatory - Library
https://jakartaresearch.github.io/earth-vision
MIT License
41 stars 11 forks source link

Aerial Cactus - Error on extract #70

Closed andreaschandra closed 3 years ago

andreaschandra commented 3 years ago

https://github.com/jakartaresearch/earth-vision/blob/ccd4455c46742b27d3bca812aadb84d74fb5cbe5/earthvision/datasets/aerialcactus.py#L98

andreaschandra commented 3 years ago
ReadError                                 Traceback (most recent call last)
<ipython-input-5-53f6d184a218> in <module>
----> 1 dataset = AerialCactus(root="./data")

~\Documents\PythonNotebook\earth-vision\earthvision\datasets\aerialcactus.py in __init__(self, root, data_mode, transform, target_transform)
     32         if not self._check_exists():
     33             self.download()
---> 34             self.extract_file()
     35 
     36         self.img_labels = self.get_path_and_label()

~\Documents\PythonNotebook\earth-vision\earthvision\datasets\aerialcactus.py in extract_file(self)
     96         """Extract file from compressed."""
     97         path_destination = os.path.join(self.root, "cactus-aerial-photos")
---> 98         shutil.unpack_archive(self.resources, path_destination)
     99         os.remove(os.path.join(self.root, self.resources))

~\AppData\Local\Continuum\anaconda3\lib\shutil.py in unpack_archive(filename, extract_dir, format)
    997         func = _UNPACK_FORMATS[format][1]
    998         kwargs = dict(_UNPACK_FORMATS[format][2])
--> 999         func(filename, extract_dir, **kwargs)
   1000 
   1001 

~\AppData\Local\Continuum\anaconda3\lib\shutil.py in _unpack_zipfile(filename, extract_dir)
    894 
    895     if not zipfile.is_zipfile(filename):
--> 896         raise ReadError("%s is not a zip file" % filename)
    897 
    898     zip = zipfile.ZipFile(filename)

ReadError: cactus-aerial-photos.zip is not a zip file
andreaschandra commented 3 years ago

shutil.unpack_archive(os.path.join(self.root, self.resources), path_destination)