Distributed error. module 'torch.distributed' has no attribute 'is_initialized'

I’ve installed pytorch 1.0 on windows.

When I try to use webcam demo provided by maskrcnn-benchmark. An error occured:

Traceback (most recent call last):
  File "webcam.py", line 80, in <module>
  File "webcam.py", line 64, in main
  File "G:\PyProjects\maskrcnn-benchmark\demo\predictor.py", line 115, in __init__
    _ = checkpointer.load(cfg.MODEL.WEIGHT)
  File "g:\pyprojects\maskrcnn-benchmark\maskrcnn_benchmark\utils\checkpoint.py", line 61, in load
    checkpoint = self._load_file(f)
  File "g:\pyprojects\maskrcnn-benchmark\maskrcnn_benchmark\utils\checkpoint.py", line 128, in _load_file
    cached_f = cache_url(f)
  File "g:\pyprojects\maskrcnn-benchmark\maskrcnn_benchmark\utils\model_zoo.py", line 44, in cache_url
    if not os.path.exists(cached_file) and is_main_process():
  File "g:\pyprojects\maskrcnn-benchmark\maskrcnn_benchmark\utils\comm.py", line 28, in is_main_process
    if not torch.distributed.is_initialized():
AttributeError: module 'torch.distributed' has no attribute 'is_initialized'

But when I checked the pytorch 1.0 document, the torch.distributed module does have the is_initialized() method.
How to solve this problem

Same issue herehyrtjedtujtuktu

We don’t support Windows for torch.distributed, unfortunately.