JonasSchult / Mask3D

Mask3D predicts accurate 3D semantic instances achieving state-of-the-art on ScanNet, ScanNet200, S3DIS and STPLS3D.
MIT License
547 stars 110 forks source link

I have some question about the version of detectron2 hydra-core and omegaconf #28

Closed lyzhenshuai closed 1 year ago

lyzhenshuai commented 1 year ago

Hello Author! When I can't get git using the URL you provided,so I used the latest version of detectron2,it need hydra-core>=1.1 and omegaconf>=2.1. I upgraded two dependent versions--------hydra-core 1.2.0 and omegaconf 2.2.3 I encountered the following problem:

Traceback (most recent call last): File "/home/ds/anaconda3/envs/mask3d/lib/python3.10/site-packages/hydra/_internal/instantiate/_instantiate2.py", line 92, in _call_target return target(*args, **kwargs) File "/home/ds/data/mask3d/Mask3D-main/models/mask3d.py", line 57, in init self.backbone = hydra.utils.instantiate(config.backbone) File "/home/ds/anaconda3/envs/mask3d/lib/python3.10/site-packages/hydra/_internal/instantiate/_instantiate2.py", line 249, in instantiate raise InstantiationException( hydra.errors.InstantiationException: Cannot instantiate config of type Res16UNet34C. Top level config must be an OmegaConf DictConfig/ListConfig object, a plain dict/list, or a Structured Config class or instance.

Traceback (most recent call last): File "/home/ds/data/mask3d/Mask3D-main/main_instance_segmentation.py", line 104, in main() File "/home/ds/anaconda3/envs/mask3d/lib/python3.10/site-packages/hydra/main.py", line 90, in decorated_main _run_hydra( File "/home/ds/anaconda3/envs/mask3d/lib/python3.10/site-packages/hydra/_internal/utils.py", line 389, in _run_hydra _run_app( File "/home/ds/anaconda3/envs/mask3d/lib/python3.10/site-packages/hydra/_internal/utils.py", line 452, in _run_app run_and_report( File "/home/ds/anaconda3/envs/mask3d/lib/python3.10/site-packages/hydra/_internal/utils.py", line 216, in run_and_report raise ex File "/home/ds/anaconda3/envs/mask3d/lib/python3.10/site-packages/hydra/_internal/utils.py", line 213, in run_and_report return func() File "/home/ds/anaconda3/envs/mask3d/lib/python3.10/site-packages/hydra/_internal/utils.py", line 453, in lambda: hydra.run( File "/home/ds/anaconda3/envs/mask3d/lib/python3.10/site-packages/hydra/internal/hydra.py", line 132, in run = ret.return_value File "/home/ds/anaconda3/envs/mask3d/lib/python3.10/site-packages/hydra/core/utils.py", line 260, in return_value raise self._return_value File "/home/ds/anaconda3/envs/mask3d/lib/python3.10/site-packages/hydra/core/utils.py", line 186, in run_job ret.return_value = task_function(task_cfg) File "/home/ds/data/mask3d/Mask3D-main/main_instance_segmentation.py", line 100, in main test(cfg) File "/home/ds/anaconda3/envs/mask3d/lib/python3.10/site-packages/hydra/main.py", line 79, in decorated_main return task_function(cfg_passthrough) File "/home/ds/data/mask3d/Mask3D-main/main_instance_segmentation.py", line 85, in test cfg, model, loggers = get_parameters(cfg) File "/home/ds/data/mask3d/Mask3D-main/main_instance_segmentation.py", line 51, in get_parameters model = InstanceSegmentation(cfg) File "/home/ds/data/mask3d/Mask3D-main/trainer/trainer.py", line 58, in init self.model = hydra.utils.instantiate(config.model) File "/home/ds/anaconda3/envs/mask3d/lib/python3.10/site-packages/hydra/_internal/instantiate/_instantiate2.py", line 222, in instantiate return instantiate_node( File "/home/ds/anaconda3/envs/mask3d/lib/python3.10/site-packages/hydra/_internal/instantiate/_instantiate2.py", line 339, in instantiate_node return _call_target(target, partial, args, kwargs, full_key) File "/home/ds/anaconda3/envs/mask3d/lib/python3.10/site-packages/hydra/_internal/instantiate/_instantiate2.py", line 97, in _call_target raise InstantiationException(msg) from e hydra.errors.InstantiationException: Error in call to target 'models.mask3d.Mask3D': InstantiationException('Cannot instantiate config of type Res16UNet34C.\nTop level config must be an OmegaConf DictConfig/ListConfig object,\na plain dict/list, or a Structured Config class or instance.') full_key: model

I want to know which the version of detectron2 hydra-core and omegaconf should be installed or 'config.backbone' and 'config.model' can be ''hydra.utils.instantiate'' called ?

Thank you!!!

Bingoang commented 1 year ago

@lyzhenshuai Hi! I met the same problem. Have you solved it?

Wenhua98 commented 1 year ago

Hi!I also met the same problem.Have you solved it?

lyzhenshuai commented 1 year ago

Hi!I also met the same problem.Have you solved it?

When installing detectron2, do not install the dependent library, and then install the old version of hydra-core and omegaconf through pip. Although there are many warnings, it can run

Bingoang commented 1 year ago

I and my friends met the same problem, and we have no ways to solve it.

Wenhua98 commented 1 year ago

Hi!I also met the same problem.Have you solved it?

When installing detectron2, do not install the dependent library, and then install the old version of hydra-core and omegaconf through pip. Although there are many warnings, it can run

Thank you for your reply. I also found out that it is enough to install hydra, omegaconf and pytorch-lightning versions on the side of the installation.

JonasSchult commented 1 year ago

Hi!

I can confirm. I did it the same way like @lyzhenshuai and @Wenhua98 . Pip complains about this, however, this ensures that the right versions are installed.

Best, Jonas

ZHANGH83 commented 1 year ago

Hi! I do not understand how to install detectron2 but do not install the dependent library, how to implement this, please? And what version does it mean for old version of hydra-core, please? I tried version hydra-core 1.0.7 & omegaconf 2.0.6 (cannot import name 'SCMode' from 'omegaconf') and hydra-core 1.0.7 & omegaconf 2.3.0 (cannot import name 'get_ref_type' from 'omegaconf._utils' ) but none can be run. So do you know how to fix this problem, please?

Darkroom-Godot commented 1 year ago

Hi! I do not understand how to install detectron2 but do not install the dependent library, how to implement this, please? And what version does it mean for old version of hydra-core, please? I tried version hydra-core 1.0.7 & omegaconf 2.0.6 (cannot import name 'SCMode' from 'omegaconf') and hydra-core 1.0.7 & omegaconf 2.3.0 (cannot import name 'get_ref_type' from 'omegaconf._utils' ) but none can be run. So do you know how to fix this problem, please?

I met the same problem. hydra-core 1.0.5 & omegaconf 2.0.6 (cannot import name 'SCMode' from 'omegaconf')

lyzhenshuai commented 1 year ago

Hi! I do not understand how to install detectron2 but do not install the dependent library, how to implement this, please? And what version does it mean for old version of hydra-core, please? I tried version hydra-core 1.0.7 & omegaconf 2.0.6 (cannot import name 'SCMode' from 'omegaconf') and hydra-core 1.0.7 & omegaconf 2.3.0 (cannot import name 'get_ref_type' from 'omegaconf._utils' ) but none can be run. So do you know how to fix this problem, please?

for example 'pip install omegaconf==2.0.6 hydra-core==1.0.5 --no-deps',Where {--no-deps} means no dependencies are installed,About (cannot import name 'SCMode' from 'omegaconf') the question, i don't meet it ,You can check whether your version contains this function

Greatest-Marx commented 1 year ago

嗨!我也遇到了同样的问题。你解决了吗?

安装 detectron2 时,不要安装依赖库,然后通过 pip 安装旧版本的 hydra-core 和 omegaconf。尽管有很多警告,但它可以运行

Hi ! I'm new to GitHub, what's your pip command line, can you tell me?

dfhe2004 commented 1 year ago

try this: https://github.com/JonasSchult/Mask3D/blob/5c5eabed4fb415c9de892404963c52e7ec02b68c/models/mask3d.py#L56

change to: self.backbone =config.backbone

LiangXu123 commented 5 months ago

try this:

https://github.com/JonasSchult/Mask3D/blob/5c5eabed4fb415c9de892404963c52e7ec02b68c/models/mask3d.py#L56

change to: self.backbone =config.backbone

you saved my day!