Closed Nationarity closed 1 year ago
Hi, may I ask what's your version of mmsegmentation?
In this repository, we use mmsegmentation==0.20.2
. If you use a newer version of mmsegmentation, it will cause this error KeyError: 'BEiT is already registered in models
, which is because BEiT is already included in official mmsegmentation.
One possible solution is to set force=True
in @BACKBONES.register_module(force=True)
, in this code.
The above is my guess on the possible cause of this error and may require more information from you.
I deeply appreciate your prompt response! MMseg is the latest v0.29.1. I did "beit.py line 293 @BACKBONES.register_module(force=True)" as you suggested. but unfortunately it did not work.
(mmseg) n@Ubuntu-D2:~/ViT-Adapter/detection/ops$ python video_demo.py demo/demo.mp4 configs/ade20k/mask2former_beitv2_adapter_large_896_80k_ade20k_ms.py checkpoints/mask2former_beitv2_adapter_large_896_80k_ade20k.pth --device cuda:0 --palette ade20k --show --output-file demo/demo-R.mp4 WARNING: CPU random generator seem to be failing, disabling hardware random number generation WARNING: RDRND generated: 0xffffffff 0xffffffff 0xffffffff 0xffffffff /home/n/miniconda3/envs/mmseg/lib/python3.8/site-packages/mmcv/__init__.py:20: UserWarning: On January 1, 2023, MMCV will release v2.0.0, in which it will remove components related to the training process and add a data transformation module. In addition, it will rename the package names mmcv to mmcv-lite and mmcv-full to mmcv. See https://github.com/open-mmlab/mmcv/blob/master/docs/en/compatibility.md for more details. warnings.warn( Traceback (most recent call last): File "video_demo.py", line 117, in <module> main() File "video_demo.py", line 60, in main model = init_segmentor(args.config, args.checkpoint, device=args.device) File "/home/n/SegNeXt-main/mmseg/apis/inference.py", line 26, in init_segmentor config = mmcv.Config.fromfile(config) File "/home/n/miniconda3/envs/mmseg/lib/python3.8/site-packages/mmcv/utils/config.py", line 340, in fromfile cfg_dict, cfg_text = Config._file2dict(filename, File "/home/n/miniconda3/envs/mmseg/lib/python3.8/site-packages/mmcv/utils/config.py", line 183, in _file2dict check_file_exist(filename) File "/home/n/miniconda3/envs/mmseg/lib/python3.8/site-packages/mmcv/utils/path.py", line 23, in check_file_exist raise FileNotFoundError(msg_tmpl.format(filename)) FileNotFoundError: file "/home/n/ViT-Adapter/detection/ops/configs/ade20k/mask2former_beitv2_adapter_large_896_80k_ade20k_ms.py" does not exist
I have made further adjustments such as creating checkpoints and config in ops. It still seems to be an obstacle.
(mmseg) n@Ubuntu-D2:~/ViT-Adapter/segmentation/ops$ python demo/video_demo.py demo/demo.mp4 configs/ade20k/mask2former_beitv2_adapter_large_896_80k_ade20k_ms.py checkpoints/mask2former_beitv2_adapter_large_896_80k_ade20k.pth --device cuda:0 --palette ade20k --show --output-file demo/demo-R.mp4 WARNING: CPU random generator seem to be failing, disabling hardware random number generation WARNING: RDRND generated: 0xffffffff 0xffffffff 0xffffffff 0xffffffff /home/n/miniconda3/envs/mmseg/lib/python3.8/site-packages/mmcv/__init__.py:20: UserWarning: On January 1, 2023, MMCV will release v2.0.0, in which it will remove components related to the training process and add a data transformation module. In addition, it will rename the package names mmcv to mmcv-lite and mmcv-full to mmcv. See https://github.com/open-mmlab/mmcv/blob/master/docs/en/compatibility.md for more details. warnings.warn( Traceback (most recent call last): File "demo/video_demo.py", line 7, in <module> import mmseg_custom # noqa: F401,F403 File "/home/n/miniconda3/envs/mmseg/lib/python3.8/site-packages/mmseg_custom/__init__.py", line 1, in <module> from .core import * # noqa: F401,F403 File "/home/n/miniconda3/envs/mmseg/lib/python3.8/site-packages/mmseg_custom/core/__init__.py", line 2, in <module> from mmseg.core.evaluation import * # noqa: F401, F403 ModuleNotFoundError: No module named 'mmseg'
I would like to discuss a better solution. Thank you in advance.
I recommend you downgrade the mmsegmentation version to 0.20.2
or 0.21.0
.
I just added a video_demo.py for generating video demos. You can use it like this:
python video_demo.py demo.mp4 configs/ade20k/mask2former_beitv2_adapter_large_896_80k_ade20k_ss.py work_dirs/mask2former_beitv2_adapter_large_896_80k_ade20k_ss/mask2former_beitv2_adapter_large_896_80k_ade20k.pth --palette ade20k --output-file results.mp4
I was able to get it to work! Thank you very much. Looks like a 1080ti is not powerful enough.
補充: 若是引用Nvidia Container Pytorch 安裝也是都要先下載特定版本 https://github.com/open-mmlab/mmcv/tree/v1.5.0, 下載zip file https://github.com/open-mmlab/mmdetection/tree/v2.22.0, 下載zip file https://github.com/open-mmlab/mmsegmentation/tree/v0.20.2, 下載zip file
另外檢查哪種cuda適用mmcv版本
https://mmcv.readthedocs.io/en/latest/get_started/installation.html
Hi, I would like to port the "MMsegmentation" video-demo.py to ViT-Adapter and run it, but it stops.
I already have
cd segmentation/ ln -s . /detection/ops . / cd ops & sh make.sh
has been done. test.py was also processed with no problems. If you have a moment, I would be happy to point this out to you!<>