多卡训练自己数据集时卡在第一个batch就不动了
zxs23130 opened this issue · comments
zxs23130 commented
Zhedong Zheng commented
你好,
- 你用的是什么卡? 4090的话把P2P封了,有可能出现这个问题。
- 单卡跑的话是OK的么?
zxs23130 commented
GTX1080,单卡可以跑通,我这边有四张卡,一起跑的话会卡住,我看了您的训练脚本train.py不知道哪里出了问题,尝试改现在还没成功,不止是多卡不行,如果我换到除0卡之外的其他卡在第10轮的时候会报tensor不在一张卡的错误,而且指定其他卡的时候也会默认在0卡运行,可能我的代码能力有限,还看不出是哪里的问题,希望您帮我解决一下,
我的训练指令是python3 train_face.py --gpu_ids 0,1,2,3 --name ft_ResNet50 --train_all --batchsize 64 --data_dir /home/iaac/zxs/code/Person_reID_baseline_pytorch-master/Market/pytorch
YCrush?
***@***.***
…------------------ 原始邮件 ------------------
发件人: "Zhedong ***@***.***>;
发送时间: 2024年1月17日(星期三) 上午9:54
收件人: ***@***.***>;
抄送: ***@***.***>; ***@***.***>;
主题: Re: [layumi/Person_reID_baseline_pytorch] 多卡训练自己数据集时卡在第一个batch就不动了 (Issue #397)
你好,你用的是什么卡? 4090的话把P2P封了,有可能出现这个问题。
单卡跑的话是OK的么?
—
Reply to this email directly, view it on GitHub, or unsubscribe.
You are receiving this because you authored the thread.Message ID: ***@***.***>
Zhedong Zheng commented
你好 @zxs23130
感谢! 我找到原因了 应该也是 torch.compile() 的 兼容性。
暂时你可以把 torch.compile() 注释了。
zxs23130 commented
谢谢
YCrush?
***@***.***
…------------------ 原始邮件 ------------------
发件人: "Zhedong ***@***.***>;
发送时间: 2024年1月24日(星期三) 下午2:37
收件人: ***@***.***>;
抄送: ***@***.***>; ***@***.***>;
主题: Re: [layumi/Person_reID_baseline_pytorch] 多卡训练自己数据集时卡在第一个batch就不动了 (Issue #397)
你好 @zxs23130
感谢! 我找到原因了 应该也是 torch.compile() 的 兼容性。
—
Reply to this email directly, view it on GitHub, or unsubscribe.
You are receiving this because you were mentioned.Message ID: ***@***.***>
Zhedong Zheng commented
Zhedong Zheng commented
另外 现在pytorch 对 DP支持比较差 我试了一下 会出现类似NaN的情况
https://discuss.pytorch.org/t/nan-loss-with-dataparallel/26501