Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Strange Loss and not training? #10

Open
ahfriedman opened this issue Jul 5, 2019 · 14 comments
Open

Strange Loss and not training? #10

ahfriedman opened this issue Jul 5, 2019 · 14 comments

Comments

@ahfriedman
Copy link

I've noticed strange values for loss when training and that I am unable to get the network to train.
I have been trying to use the CD2014 dataset, More specifically the PTZ/twoPositionPTZCam/ images.

I'm not sure what really to say or what documentation to provide, so if I need to add anything please let me know.
It's quite possible that I'm just doing something or many things wrong but I'd appreciate any help.

loss1
loss2

@852569069
Copy link

I met the same problem, have you solve it?

@852569069
Copy link

pytorch 版本不能太新。实测0.3.1能用,否则loss会很大

@ahfriedman
Copy link
Author

I met the same problem, have you solve it?
I have not solved it.
我还没有解决它。

pytorch 版本不能太新。实测0.3.1能用,否则loss会很大
Is it working by using pytorch 0.3.1 or an older version?
是它的工作通过使用pytorch 0.3.1或更早的版本?

@Rikaaaaaa95
Copy link

I've noticed strange values for loss when training and that I am unable to get the network to train.
I have been trying to use the CD2014 dataset, More specifically the PTZ/twoPositionPTZCam/ images.

I'm not sure what really to say or what documentation to provide, so if I need to add anything please let me know.
It's quite possible that I'm just doing something or many things wrong but I'd appreciate any help.

loss1
loss2

你解决了这个问题了么,我和你一样的问题

@louxiantuo
Copy link

请问可以分享下data下的txt文件么?不太懂如何去生成

@xingE650
Copy link

我在layer/loss.py的ConstractiveLoss类的forward方法中加入label = torch.squeeze(label,dim=1),可以解决loss过大的问题。我的版本是python3.6,pytorch1.5.1+cu101。可能具体修改的位置有出入,但是我发现出现loss过大的原因是label*distance计算中,前者的size是[4225,1],而后者是[4225,],把前者也改为[4225,]应该就可以解决了。

@louxiantuo
Copy link

louxiantuo commented Jul 16, 2020 via email

@xingE650
Copy link

非常感谢您的解答,我有空的时候再回头去看一下,请问你的loss function收敛了么?另外可不可以test model,他没有单独写test,所以,可能只能从valuetion中去找他的test了。还是非常感谢你的建议,你是研究生来做这个方面研究来发paper么? 发送自 Windows 10 版邮件<https://go.microsoft.com/fwlink/?LinkId=550986>应用 发件人: xingE650mailto:[email protected] 发送时间: 2020年7月16日 15:24 收件人: gmayday1997/SceneChangeDetmailto:[email protected] 抄送: louxiantuomailto:[email protected]; Commentmailto:[email protected] 主题: Re: [gmayday1997/SceneChangeDet] Strange Loss and not training? (#10) 我在layer/loss.py的ConstractiveLoss类的forward方法中加入label = torch.squeeze(label,dim=1),可以解决loss过大的问题。我的版本是python3.6,pytorch1.5.1+cu101。可能具体修改的位置有出入,但是我发现出现loss过大的原因是label*distance计算中,前者的size是[4225,1],而后者是[4225,],把前者也改为[4225,]应该就可以解决了。 ― You are receiving this because you commented. Reply to this email directly, view it on GitHub<#10 (comment)>, or unsubscribehttps://github.com/notifications/unsubscribe-auth/AETTUB5AQ547HL6B6IKEDRTR32TJBANCNFSM4H6M6P6Q.

只是刚刚解决了loss过大不收敛的问题,因为作者的代码不支持多GPU,batch size>1,tensorboard可视化等功能,所以我还在修改代码,现在没办法回答您的问题。

@louxiantuo
Copy link

louxiantuo commented Jul 16, 2020 via email

@louxiantuo
Copy link

louxiantuo commented Jul 21, 2020 via email

@louxiantuo
Copy link

louxiantuo commented Jul 21, 2020 via email

@xingE650
Copy link

你之前说的ConstractiveLoss类中的forward方法,我去看了以下,他这个hhh和hhhh看不懂在哪里用到了。Loss不收敛的问题是如何解决的?我按照你的方式,添加了[cid:[email protected]] 但是似乎没有效果 发送自 Windows 10 版邮件<https://go.microsoft.com/fwlink/?LinkId=550986>应用 发件人: xingE650mailto:[email protected] 发送时间: 2020年7月16日 17:13 收件人: gmayday1997/SceneChangeDetmailto:[email protected] 抄送: louxiantuomailto:[email protected]; Commentmailto:[email protected] 主题: Re: [gmayday1997/SceneChangeDet] Strange Loss and not training? (#10) 非常感谢您的解答,我有空的时候再回头去看一下,请问你的loss function收敛了么?另外可不可以test model,他没有单独写test,所以,可能只能从valuetion中去找他的test了。还是非常感谢你的建议,你是研究生来做这个方面研究来发paper么? 发送自 Windows 10 版邮件<[https://go.microsoft.com/fwlink/?LinkId=550986>应用https://go.microsoft.com/fwlink/?LinkId=550986%3E%E5%BA%94%E7%94%A8](https://go.microsoft.com/fwlink/?LinkId=550986%E5%BA%94%E7%94%A8https://go.microsoft.com/fwlink/?LinkId=550986%3E%E5%BA%94%E7%94%A8) 发件人: xingE650mailto:[email protected] 发送时间: 2020年7月16日 15:24 收件人: gmayday1997/SceneChangeDetmailto:[email protected] 抄送: louxiantuomailto:[email protected]; Commentmailto:[email protected] 主题: Re: [gmayday1997/SceneChangeDet] Strange Loss and not training? (#10<#10>) 我在layer/loss.py的ConstractiveLoss类的forward方法中加入label = torch.squeeze(label,dim=1),可以解决loss过大的问题。我的版本是python3.6,pytorch1.5.1+cu101。可能具体修改的位置有出入,但是我发现出现loss过大的原因是label*distance计算中,前者的size是[4225,1],而后者是[4225,],把前者也改为[4225,]应该就可以解决了。 D You are receiving this because you commented. Reply to this email directly, view it on GitHub<#10 (comment)<#10 (comment)>>, or unsubscribehttps://github.com/notifications/unsubscribe-auth/AETTUB5AQ547HL6B6IKEDRTR32TJBANCNFSM4H6M6P6Q. 只是刚刚解决了loss过大不收敛的问题,因为作者的代码不支持多GPU,batch size>1,tensorboard可视化等功能,所以我还在修改代码,现在没办法回答您的问题。 ― You are receiving this because you commented. Reply to this email directly, view it on GitHub<#10 (comment)>, or unsubscribehttps://github.com/notifications/unsubscribe-auth/AETTUB2QEKQEM64ZK3SDEBDR33AEBANCNFSM4H6M6P6Q.

不好意思,我也没解决loss不收敛的问题,最近有别的事情就没什么时间弄这个了...

@louxiantuo
Copy link

louxiantuo commented Jul 21, 2020 via email

@Vijayraven95
Copy link

你之前说的ConstractiveLoss类中的forward方法,我去看了以下,他这个hhh和hhhh看不懂在哪里用到了。Loss不收敛的问题是如何解决的?我按照你的方式,添加了[cid:[email protected]] 但是似乎没有效果 发送自 Windows 10 版邮件<https://go.microsoft.com/fwlink/?LinkId=550986>应用 发件人: xingE650mailto:[email protected] 发送时间: 2020年7月16日 17:13 收件人: gmayday1997/SceneChangeDetmailto:[email protected] 抄送: louxiantuomailto:[email protected]; Commentmailto:[email protected] 主题: Re: [gmayday1997/SceneChangeDet] Strange Loss and not training? (#10) 非常感谢您的解答,我有空的时候再回头去看一下,请问你的loss function收敛了么?另外可不可以test model,他没有单独写test,所以,可能只能从valuetion中去找他的test了。还是非常感谢你的建议,你是研究生来做这个方面研究来发paper么? 发送自 Windows 10 版邮件<https://go.microsoft.com/fwlink/?LinkId=550986>应用[https://go.microsoft.com/fwlink/?LinkId=550986%3E%E5%BA%94%E7%94%A8](https://go.microsoft.com/fwlink/?LinkId=550986 发件人: xingE650mailto:[email protected] 发送时间: 2020年7月16日 15:24 收件人: gmayday1997/SceneChangeDetmailto:[email protected] 抄送: louxiantuomailto:[email protected]; Commentmailto:[email protected] 主题: Re: [gmayday1997/SceneChangeDet] Strange Loss and not training? (#10<#10>) 我在layer/loss.py的ConstractiveLoss类的forward方法中加入label = torch.squeeze(label,dim=1),可以解决loss过大的问题。我的版本是python3.6,pytorch1.5.1+cu101。可能具体修改的位置有出入,但是我发现出现loss过大的原因是label*distance计算中,前者的size是[4225,1],而后者是[4225,],把前者也改为[4225,]应该就可以解决了。 D You are receiving this because you commented. Reply to this email directly, view it on GitHub<#10 (comment)<#10 (comment)>>, or unsubscribehttps://github.com/notifications/unsubscribe-auth/AETTUB5AQ547HL6B6IKEDRTR32TJBANCNFSM4H6M6P6Q. 只是刚刚解决了loss过大不收敛的问题,因为作者的代码不支持多GPU,batch size>1,tensorboard可视化等功能,所以我还在修改代码,现在没办法回答您的问题。 ― You are receiving this because you commented. Reply to this email directly, view it on GitHub<#10 (comment)>, or unsubscribehttps://github.com/notifications/unsubscribe-auth/AETTUB2QEKQEM64ZK3SDEBDR33AEBANCNFSM4H6M6P6Q.

不好意思,我也没解决loss不收敛的问题,最近有别的事情就没什么时间弄这个了...

I am also facing the problem of high loss value and non- convergence. I changed the label and target value to the same dimension (4225) using label.squeeze, but still facing strange loss. What should I modify to attain model convergence? Could you guys help me out ? I am using python 3.6 and pytorch latest version (1.8).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants