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

KeyError: 'CustomDepthDataset is already registered in dataset' #91

Open
firaterdem opened this issue Sep 7, 2023 · 1 comment
Open

Comments

@firaterdem
Copy link

firaterdem commented Sep 7, 2023

I am getting this error while implementing the code for the custom dataset. How can I solve it?

(MDE) D:\FIRAT\Güncel\Postdoc_2218\Process\Monocular-Depth-Estimation-Toolbox-main>python tools/train.py tools/depth/datasets/custom.py Traceback (most recent call last): File "tools/train.py", line 168, in <module> main() File "tools/train.py", line 67, in main cfg = Config.fromfile(args.config) File "C:\Users\firat\anaconda3\envs\MDE\lib\site-packages\mmcv\utils\config.py", line 335, in fromfile use_predefined_variables) File "C:\Users\firat\anaconda3\envs\MDE\lib\site-packages\mmcv\utils\config.py", line 206, in _file2dict mod = import_module(temp_module_name) File "C:\Users\firat\anaconda3\envs\MDE\lib\importlib\__init__.py", line 127, in import_module return _bootstrap._gcd_import(name[level:], package, level) File "<frozen importlib._bootstrap>", line 1006, in _gcd_import File "<frozen importlib._bootstrap>", line 983, in _find_and_load File "<frozen importlib._bootstrap>", line 967, in _find_and_load_unlocked File "<frozen importlib._bootstrap>", line 677, in _load_unlocked File "<frozen importlib._bootstrap_external>", line 728, in exec_module File "<frozen importlib._bootstrap>", line 219, in _call_with_frames_removed File "C:\Users\firat\AppData\Local\Temp\tmp396gff_i\tmpei0oe1p3.py", line 27, in <module> File "C:\Users\firat\anaconda3\envs\MDE\lib\site-packages\mmcv\utils\registry.py", line 313, in _register module_class=cls, module_name=name, force=force) File "C:\Users\firat\anaconda3\envs\MDE\lib\site-packages\mmcv\utils\registry.py", line 246, in _register_module raise KeyError(f'{name} is already registered ' KeyError: 'CustomDepthDataset is already registered in dataset'

I am using tools/depth/datasets/custom.py as a config file. Also, my folder structure is as follows:

data/custom/train/depth
data/custom/train/rgb
data/custom/val/depth
data/custom/val/rgb

@zhyever
Copy link
Owner

zhyever commented Sep 7, 2023

That could be something related to 'https://github.com/zhyever/Monocular-Depth-Estimation-Toolbox/blob/main/depth/datasets/custom.py'. If you def a new CustomDepthDataset class, there could be such a error thrown out, because the CustomDepthDataset has already been registered in this file.

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