DeepLSD icon indicating copy to clipboard operation
DeepLSD copied to clipboard

Attribute Error occurs 'Ground truth (GT) generation' step

Open sktm502 opened this issue 1 year ago • 1 comments

Hi. I encounter 'AttributeError: 'NoneType' object has no attribute 'shape'' error when excute Ground truth (GT) generation step.(I`m using python 3.12) I commanded as below.

python -m deeplsd.scripts.homography_adaptation_df C:\DeepLSD2\DeepLSD\dataset\img_list.txt C:\DeepLSD2\DeepLSD\GT_output --num_H 100 --n_jobs 5

It seems some calculation did incorrectly. I think that install dependencies corretly, but I'm not confident.

whole output is as below

(deeplsd2) c:\DeepLSD2\DeepLSD>python -m deeplsd.scripts.homography_adaptation_df C:\DeepLSD2\DeepLSD\dataset\img_list.txt C:\DeepLSD2\DeepLSD\GT_output --num_H 100 --n_jobs -1 100%|█████████████████████████████████████████████████████████████████████████████████| 16/16 [00:00<00:00, 185.53it/s] [ WARN:[email protected]] global loadsave.cpp:241 cv::findDecoder imread_('C:/DeepLSD/dataset/v1.1/test/00031597.jpg'): can't open/read file: check file path/integrity joblib.externals.loky.process_executor._RemoteTraceback: """ Traceback (most recent call last): File "C:\Users\jonghak\anaconda3\envs\deeplsd2\Lib\site-packages\joblib_utils.py", line 72, in call return self.func(**kwargs) ^^^^^^^^^^^^^^^^^^^ File "C:\Users\jonghak\anaconda3\envs\deeplsd2\Lib\site-packages\joblib\parallel.py", line 598, in call return [func(*args, **kwargs) ^^^^^^^^^^^^^^^^^^^^^ File "c:\DeepLSD2\DeepLSD\deeplsd\scripts\homography_adaptation_df.py", line 135, in process_image df, angle, closest, bg_mask = ha_df(img, num=num_H) ^^^^^^^^^^^^^^^^^^^^^ File "c:\DeepLSD2\DeepLSD\deeplsd\scripts\homography_adaptation_df.py", line 46, in ha_df h, w = img.shape[:2] ^^^^^^^^^ AttributeError: 'NoneType' object has no attribute 'shape' """

The above exception was the direct cause of the following exception:

Traceback (most recent call last): File "", line 198, in _run_module_as_main File "", line 88, in _run_code File "c:\DeepLSD2\DeepLSD\deeplsd\scripts\homography_adaptation_df.py", line 176, in export_ha(args.images_list, args.output_folder, args.num_H, File "c:\DeepLSD2\DeepLSD\deeplsd\scripts\homography_adaptation_df.py", line 158, in export_ha Parallel(n_jobs=n_jobs, backend='multiprocessing')(delayed(process_image)( File "C:\Users\jonghak\anaconda3\envs\deeplsd2\Lib\site-packages\joblib\parallel.py", line 2007, in call return output if self.return_generator else list(output) ^^^^^^^^^^^^ File "C:\Users\jonghak\anaconda3\envs\deeplsd2\Lib\site-packages\joblib\parallel.py", line 1650, in _get_outputs yield from self._retrieve() File "C:\Users\jonghak\anaconda3\envs\deeplsd2\Lib\site-packages\joblib\parallel.py", line 1754, in _retrieve self._raise_error_fast() File "C:\Users\jonghak\anaconda3\envs\deeplsd2\Lib\site-packages\joblib\parallel.py", line 1789, in _raise_error_fast error_job.get_result(self.timeout) File "C:\Users\jonghak\anaconda3\envs\deeplsd2\Lib\site-packages\joblib\parallel.py", line 745, in get_result return self._return_or_raise() ^^^^^^^^^^^^^^^^^^^^^^^ File "C:\Users\jonghak\anaconda3\envs\deeplsd2\Lib\site-packages\joblib\parallel.py", line 763, in _return_or_raise raise self._result AttributeError: 'NoneType' object has no attribute 'shape'

Thank you for your coorperation in advance

sktm502 avatar Dec 10 '24 05:12 sktm502

Hi, this is very likely due to the fact the the path to your images is wrong. First check that the paths to the images in your txt file are all correct (in particular the one failing here, C:/DeepLSD/dataset/v1.1/test/00031597.jpg). Then I see that you are using Windows here. I have never used this repo on Windows and cannot guarantee that it will work out of the box. But it could be that the paths needs to be adapted for Windows.

rpautrat avatar Dec 10 '24 07:12 rpautrat