Hi,
I am trying to import data from Tiff images to EOPatch. Tiff images are located on a different drive (O:\), my working directory is on D:\. When I run the script for importing, I get the “No such file or directory” error (note, the path in the error message starts with the letter D:\, but it should with O:\).
I passed an absolute path of the tiff folder (O:\aitlas_slc_SI_sigma…), so I do not understand why the drive changes (I guess, somewhere in fs\osfs.py). I am working on Windows. I also tried to pass the path as raw string literals, double backslashes, and forward slashes, the result was the same.
Any idea how to solve this?
Example code:
import_from_tiff = ImportFromTiff(folder='o:/aitlas_slc_SI_sigma/yr17wk01_SLC_SIG_20170101_20170106_weekly/',
feature=(FeatureType.DATA, 'weekly_data'),
# timestamp_size=4,
image_dtype=np.float32)
import_from_tiff.execute(eopatch, filename='20170101_20170106_weekly_SLC_SIG_ASC_VH_yr17wk01.tif')
Traceback (most recent call last):
File "C:\Users\adraksler\.conda\envs\aitlas\lib\site-packages\fs\osfs.py", line 360, in openbin
sys_path, mode=_mode.to_platform_bin(), buffering=buffering, **options
FileNotFoundError: rErrno 2] No such file or directory: b'D:\\aitlas_slc_SI_sigma\\yr17wk01_SLC_SIG_20170101_20170106_weekly\\20170101_20170106_weekly_SLC_SIG_ASC_VH_yr17wk01.tif'
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "C:\Users\adraksler\.conda\envs\aitlas\lib\site-packages\IPython\core\interactiveshell.py", line 3343, in run_code
exec(code_obj, self.user_global_ns, self.user_ns)
File "<ipython-input-13-4162f2179dee>", line 5, in <module>
import_from_tiff.execute(eopatch, filename='20170101_20170106_weekly_SLC_SIG_ASC_VH_yr17wk01.tif')
File "C:\Users\adraksler\.conda\envs\aitlas\lib\site-packages\eolearn\io\local_io.py", line 408, in execute
with filesystem.openbin(path, 'r') as file_handle:
File "C:\Users\adraksler\.conda\envs\aitlas\lib\site-packages\fs\osfs.py", line 360, in openbin
sys_path, mode=_mode.to_platform_bin(), buffering=buffering, **options
File "C:\Users\adraksler\.conda\envs\aitlas\lib\site-packages\fs\error_tools.py", line 90, in __exit__
reraise(fserror, fserror(self._path, exc=exc_value), traceback)
File "C:\Users\adraksler\.conda\envs\aitlas\lib\site-packages\six.py", line 702, in reraise
raise value.with_traceback(tb)
File "C:\Users\adraksler\.conda\envs\aitlas\lib\site-packages\fs\osfs.py", line 360, in openbin
sys_path, mode=_mode.to_platform_bin(), buffering=buffering, **options
fs.errors.ResourceNotFound: resource 'aitlas_slc_SI_sigma/yr17wk01_SLC_SIG_20170101_20170106_weekly/20170101_20170106_weekly_SLC_SIG_ASC_VH_yr17wk01.tif' not found