TangXu-Group / Remote-Sensing-Images-Classification

the official TangXu's group released codes about the Remote Sensing images classificaiton
24 stars 5 forks source link

训练问题 #4

Open lixingyi19 opened 11 months ago

lixingyi19 commented 11 months ago

您好,我在训练的时候并没有修改您的代码,遇到了Function 'XlogyBackward0' returned nan values in its 1th output.的错误,请问是怎么回事

rachel-lyq commented 6 months ago

请问您的问题解决了吗,我遇到了同样的问题

liuyan-design commented 3 months ago

您好,我在训练的时候并没有修改您的代码,遇到了Function 'XlogyBackward0' returned nan values in its 1th output.的错误,请问是怎么回事

你好,我还没开始训练,数据读取就有问题(https://github.com/TangXu-Group/Remote-Sensing-Images-Classification/issues/5#issue-2407441229). 可以分享一下数据目录结构么?

liuyan-design commented 3 months ago

请问您的问题解决了吗,我遇到了同样的问题

你好,我还没开始训练,数据读取就有问题(https://github.com/TangXu-Group/Remote-Sensing-Images-Classification/issues/5#issue-2407441229). 可以分享一下数据目录结构么?

ALiAN4011 commented 2 weeks ago

您好,我在训练的时候并没有修改您的代码,遇到了Function 'XlogyBackward0' returned nan values in its 1th output.的错误,请问是怎么回事

Function 'XlogyBackward0' returned nan values in its 1th output.是因为梯度爆炸了,与这行代码有关 MI_losses = [F.kl_div(raw_logits, F.softmax(logits, -1), size_average=True) for logits in logits_dict] 我将其修改为MI_losses = [F.kl_div(raw_logits, torch.clamp(F.softmax(logits, -1), 1e-8), size_average=True) for logits in logits_dict]解决了问题,希望对你有用。