hustvl / ViTMatte

[Information Fusion (Vol.103, Mar. '24)] Boosting Image Matting with Pretrained Plain Vision Transformers
MIT License
371 stars 37 forks source link

One GPU #16

Closed EagleAiDi closed 1 year ago

EagleAiDi commented 1 year ago

Hello, thank you for the excellent work. If I only have one GPU for training, what should I do?

Traceback (most recent call last): File "main.py", line 130, in launch( File "d:\desktop\image\vitmatte\vitmatte\detectron2\detectron2\engine\launch.py", line 84, in launch main_func(*args) File "main.py", line 125, in main do_train(args, cfg) File "main.py", line 77, in do_train train_loader = instantiate(cfg.dataloader.train) File "d:\desktop\image\vitmatte\vitmatte\detectron2\detectron2\config\instantiate.py", line 67, in instantiate cfg = {k: instantiate(v) for k, v in cfg.items()} File "d:\desktop\image\vitmatte\vitmatte\detectron2\detectron2\config\instantiate.py", line 67, in cfg = {k: instantiate(v) for k, v in cfg.items()} File "d:\desktop\image\vitmatte\vitmatte\detectron2\detectron2\config\instantiate.py", line 83, in instantiate return cls(**cfg) File "D:\Anaconda\envs\ViTMatte3\lib\site-packages\torch\utils\data\distributed.py", line 68, in init num_replicas = dist.get_world_size() File "D:\Anaconda\envs\ViTMatte3\lib\site-packages\torch\distributed\distributed_c10d.py", line 1181, in get_world_size return _get_group_size(group) File "D:\Anaconda\envs\ViTMatte3\lib\site-packages\torch\distributed\distributed_c10d.py", line 566, in _get_group_size default_pg = _get_default_group() File "D:\Anaconda\envs\ViTMatte3\lib\site-packages\torch\distributed\distributed_c10d.py", line 697, in _get_default_group raise RuntimeError( RuntimeError: Default process group has not been initialized, please make sure to call init_process_group.

JingfengYao commented 1 year ago

You can change the code here: https://github.com/hustvl/ViTMatte/blob/main/configs/common/dataloader.py#L26. Comment the 'sampler' and enable the parameter 'shuffle'.

EagleAiDi commented 1 year ago

You can change the code here: https://github.com/hustvl/ViTMatte/blob/main/configs/common/dataloader.py#L26. Comment the 'sampler' and enable the parameter 'shuffle'.

I have successfully run it; it's an outstanding piece of work. Thank you for your assistance.