脚本文件多卡运行 Place CUDAPlace(0) is not supported.
收藏
各位有遇到这种情况不, 还是我的分布式初始化 有错误?
报错:
0
收藏
请登录后评论
初始化 分布训练 NCCL通信 不是两步吗 初始化并行环境 init_parallel_env() 将模型置为数据并行 paddle.DataParallel(model) 是还需要其他?
本地还是ai studio?
在 AI Stdio 中的脚本任务
ai studio上的应该paddle配置是没有问题的。
2.0版本后多卡有两种配置方式了,也可以试试spwan
可以参考文档:
https://www.paddlepaddle.org.cn/documentation/docs/zh/guides/02_paddle2.0_develop/06_device_cn.html
尝试了spwan 跑起来了 但训练过程 是一张卡在跑
main函数 我用的是 2.0.2版本
我也遇到过只用单张卡训练的情况,使用 DistributedBatchSampler 解决的。直接用 DataLoader 是可能出问题的。
DistributedBatchSampler使用参考:
https://www.paddlepaddle.org.cn/documentation/docs/zh/api/paddle/io/DistributedBatchSampler_cn.html#distributedbatchsampler