参考了好多的博文,亲测这篇博文AttributeError: module ‘torch.distributed‘ has no attribute ‘deprecated‘问题解决方案_attributeerror: module 'torch.distributed' has no -CSDN博客有效,方法:
git clone https://github.com/ptrblck/apex.git
cd apex
git checkout apex_no_distributed
pip install -v --no-cache-dir ./