Windows下 pytorch 分布式训练方法

torch1.7 以下版本不支持Windows下的分布式训练,会报错 AttributeError: module ‘torch.distributed‘ has no attribute ‘init_process_group‘ 。 步

torch1.7 以下版本不支持Windows下的分布式训练,会报错 AttributeError: module ‘torch.distributed‘ has no attribute ‘init_process_group‘

步骤:

1、将本机torch版本升到1.7.0以上,torchvision升到对应的0.8.0版本以上。(1.5~1.8 版本的 torch 代码基本都兼容)

温馨提示:建议离线下载 torch1.7.1 版本,torchvision0.8.2 版本。

下载链接如下:

https://download.pytorch/whl/

2、更换torch版本之后,在Windows下运行之前,将 init_process_group 函数的参数更改为以下内容:

torch.distributed.init_process_group(	backend="gloo", 
									

发布者:admin,转转请注明出处:http://www.yc00.com/web/1734976295a3774013.html

相关推荐

发表回复

评论列表(0条)

  • 暂无评论

联系我们

400-800-8888

在线咨询: QQ交谈

邮件:admin@example.com

工作时间:周一至周五,9:30-18:30,节假日休息

关注微信