Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
sktm502 opened this issue Dec 10, 2024 · 1 comment
Open

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

sktm502 opened this issue Dec 10, 2024 · 1 comment

Comments

@sktm502
Copy link

sktm502 commented Dec 10, 2024

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:0@6.295] 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

@rpautrat
Copy link
Member

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants