移动建站平台有哪些,建设门户网站需要注意什么意思,专门做自由行的网站,南京高端定制网站建设将find_unused_parameters改成False之后#xff0c;如果出现模型有些参数未参与loss计算等错误。 可以用环境变量来debug查看log。
export TORCH_DISTRIBUTED_DEBUGDETAIL 代码上可以用以下方法查看。
# check parameters with no grad
for n, p in model.named_parameters(…将find_unused_parameters改成False之后如果出现模型有些参数未参与loss计算等错误。 可以用环境变量来debug查看log。
export TORCH_DISTRIBUTED_DEBUGDETAIL 代码上可以用以下方法查看。
# check parameters with no grad
for n, p in model.named_parameters():if p.grad is None and p.requires_grad is True:print(No forward parameters:, n, p.shape)可以将这些未用到的参数注释掉。
或者乘以0与模型的loss进行相加使未用到的参数也参入了loss计算。
for p in self.parameters():loss 0.0 * p.sum()