No module named torch.distributed

Viewed 9370

ImportError: No module named torch.distributed

File "train.py", line 4, in <module>
    import torch.distributed as dist
ImportError: No module named torch.distributed

I installed CUDA AND cuDNN then created env and installed pip3 install torch torchvision but getting error.

1 Answers

This works for me:

  1. Create a conda virtual environment:

    conda create -n env_pytorch python=3.6
    
  2. Active this environment create above:

    source activate env_pytorch
    
  3. Install PyTorch with pip or pip3:

    pip install torchvision --user
    
Related