fudan-zvg / SETR

[CVPR 2021] Rethinking Semantic Segmentation from a Sequence-to-Sequence Perspective with Transformers
MIT License
1.05k stars 150 forks source link

ZeroDivisionError: integer division or modulo by zero #50

Closed selael123 closed 2 years ago

selael123 commented 2 years ago

Hi thanks for share the code, i got some problem plz help me. i have only one GPU my mmcv and pytorch version is the same as the readme.md.

(base) root@Pub:/mnt/c/Users/Pub/SETR# ./tools/dist_test.sh configs/SETR/SETR_PUP_768x768_40k_cityscapes_bs_8.py work_dirs/SETR_PUP_768x768_40k_cityscapes_bs_8/iter_40000.pth 1 --eval mIoU Traceback (most recent call last): File "./tools/test.py", line 144, in main() File "./tools/test.py", line 100, in main init_dist(args.launcher, cfg.dist_params) File "/root/miniconda3/lib/python3.7/site-packages/mmcv/runner/dist_utils.py", line 20, in init_dist _init_dist_pytorch(backend, kwargs) File "/root/miniconda3/lib/python3.7/site-packages/mmcv/runner/dist_utils.py", line 33, in _init_dist_pytorch torch.cuda.set_device(rank % num_gpus) ZeroDivisionError: integer division or modulo by zero Traceback (most recent call last): File "/root/miniconda3/lib/python3.7/runpy.py", line 193, in _run_module_as_main "main", mod_spec) File "/root/miniconda3/lib/python3.7/runpy.py", line 85, in _run_code exec(code, run_globals) File "/root/miniconda3/lib/python3.7/site-packages/torch/distributed/launch.py", line 261, in main() File "/root/miniconda3/lib/python3.7/site-packages/torch/distributed/launch.py", line 257, in main cmd=cmd) subprocess.CalledProcessError: Command '['/root/miniconda3/bin/python', '-u', './tools/test.py', '--local_rank=0', 'configs/SETR/SETR_PUP_768x768_40k_cityscapes_bs_8.py', 'work_dirs/SETR_PUP_768x768_40k_cityscapes_bs_8/iter_40000.pth', '--launcher', 'pytorch', '--eval', 'mIoU']' returned non-zero exit status 1.

selael123 commented 2 years ago

19 I see, so my problem is i have only one GPU.