记Pycharm并行调试服务器代码 debug configurations设置idea → edit configuration → allow parallel run设置script path:直接复制服务器环境下torch下launch.py的路径(如果只能看到本地路径的话,就直接复制进行就可)设置parameters:--nproc_per_node=2使用两张卡,然后是你要运行的train文件和参数设置。 debug configurations设置 idea → edit configuration → allow parallel run 设置script path:直接复制服务器环境下torch下launch.py的路径(如果只能看到本地路径的话,就直接复制进行就可) 设置parameters:–nproc_per_node=2使用两张卡,然后是你要运行的train文件和参数设置。 参考:Pycharm 调试debug torch.distributed.launch