I'm getting this below error when importing Pytorch.
"cannot import name 'invoke_remote_python_udf' from 'torch.distributed'"
I faced the similar problem. For me , the problem was occuring due to mismatch in cuda version. I am using conda environment.
In my system the nvcc --version showed the result as 10.0' , while I had mistakenly install the pytorch for cuda version10.1`
I removed the torch and torchvision and re-installed them using the following command:
conda install pytorch torchvision cuda100 -c pytorch.
Installing the package cuda100 solved the problem.