gmayday1997 / SceneChangeDet

pytorch implementation of scene change detection
MIT License
234 stars 73 forks source link

Strange Loss and not training? #10

Open ahfriedman opened 5 years ago

ahfriedman commented 5 years ago

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 commented 5 years ago

I met the same problem, have you solve it?

852569069 commented 5 years ago

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

ahfriedman commented 5 years ago

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 commented 4 years ago

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 commented 4 years ago

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

xingE650 commented 4 years ago

我在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 commented 4 years ago

非常感谢您的解答,我有空的时候再回头去看一下,请问你的loss function收敛了么?另外可不可以test model,他没有单独写test,所以,可能只能从valuetion中去找他的test了。还是非常感谢你的建议,你是研究生来做这个方面研究来发paper么? 发送自 Windows 10 版邮件https://go.microsoft.com/fwlink/?LinkId=550986应用

发件人: xingE650mailto:notifications@github.com 发送时间: 2020年7月16日 15:24 收件人: gmayday1997/SceneChangeDetmailto:SceneChangeDet@noreply.github.com 抄送: louxiantuomailto:louxiantuo@outlook.com; Commentmailto:comment@noreply.github.com 主题: 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 GitHubhttps://github.com/gmayday1997/SceneChangeDet/issues/10#issuecomment-659212632, or unsubscribehttps://github.com/notifications/unsubscribe-auth/AETTUB5AQ547HL6B6IKEDRTR32TJBANCNFSM4H6M6P6Q.

xingE650 commented 4 years ago

非常感谢您的解答,我有空的时候再回头去看一下,请问你的loss function收敛了么?另外可不可以test model,他没有单独写test,所以,可能只能从valuetion中去找他的test了。还是非常感谢你的建议,你是研究生来做这个方面研究来发paper么? 发送自 Windows 10 版邮件<https://go.microsoft.com/fwlink/?LinkId=550986>应用 发件人: xingE650mailto:notifications@github.com 发送时间: 2020年7月16日 15:24 收件人: gmayday1997/SceneChangeDetmailto:SceneChangeDet@noreply.github.com 抄送: louxiantuomailto:louxiantuo@outlook.com; Commentmailto:comment@noreply.github.com 主题: 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 commented 4 years ago

好,感谢你能分享你的实验。相信你能在科研路上更进一步。

发送自 Windows 10 版邮件https://go.microsoft.com/fwlink/?LinkId=550986应用

发件人: xingE650mailto:notifications@github.com 发送时间: 2020年7月16日 17:13 收件人: gmayday1997/SceneChangeDetmailto:SceneChangeDet@noreply.github.com 抄送: louxiantuomailto:louxiantuo@outlook.com; Commentmailto:comment@noreply.github.com 主题: 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 发件人: xingE650mailto:notifications@github.com 发送时间: 2020年7月16日 15:24 收件人: gmayday1997/SceneChangeDetmailto:SceneChangeDet@noreply.github.com 抄送: louxiantuomailto:louxiantuo@outlook.com; Commentmailto:comment@noreply.github.com 主题: Re: [gmayday1997/SceneChangeDet] Strange Loss and not training? (#10https://github.com/gmayday1997/SceneChangeDet/issues/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)https://github.com/gmayday1997/SceneChangeDet/issues/10#issuecomment-659212632>, 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 GitHubhttps://github.com/gmayday1997/SceneChangeDet/issues/10#issuecomment-659279889, or unsubscribehttps://github.com/notifications/unsubscribe-auth/AETTUB2QEKQEM64ZK3SDEBDR33AEBANCNFSM4H6M6P6Q.

louxiantuo commented 4 years ago

你好,我拿到一个GPU资源,我想跟你交流下这个实验,方便留个微信或者qq么?

发送自 Windows 10 版邮件https://go.microsoft.com/fwlink/?LinkId=550986应用

发件人: xingE650mailto:notifications@github.com 发送时间: 2020年7月16日 17:13 收件人: gmayday1997/SceneChangeDetmailto:SceneChangeDet@noreply.github.com 抄送: louxiantuomailto:louxiantuo@outlook.com; Commentmailto:comment@noreply.github.com 主题: 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 发件人: xingE650mailto:notifications@github.com 发送时间: 2020年7月16日 15:24 收件人: gmayday1997/SceneChangeDetmailto:SceneChangeDet@noreply.github.com 抄送: louxiantuomailto:louxiantuo@outlook.com; Commentmailto:comment@noreply.github.com 主题: Re: [gmayday1997/SceneChangeDet] Strange Loss and not training? (#10https://github.com/gmayday1997/SceneChangeDet/issues/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)https://github.com/gmayday1997/SceneChangeDet/issues/10#issuecomment-659212632>, 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 GitHubhttps://github.com/gmayday1997/SceneChangeDet/issues/10#issuecomment-659279889, or unsubscribehttps://github.com/notifications/unsubscribe-auth/AETTUB2QEKQEM64ZK3SDEBDR33AEBANCNFSM4H6M6P6Q.

louxiantuo commented 4 years ago

你之前说的ConstractiveLoss类中的forward方法,我去看了以下,他这个hhh和hhhh看不懂在哪里用到了。Loss不收敛的问题是如何解决的?我按照你的方式,添加了[cid:image003.png@01D65F6A.94E53630] 但是似乎没有效果

发送自 Windows 10 版邮件https://go.microsoft.com/fwlink/?LinkId=550986应用

发件人: xingE650mailto:notifications@github.com 发送时间: 2020年7月16日 17:13 收件人: gmayday1997/SceneChangeDetmailto:SceneChangeDet@noreply.github.com 抄送: louxiantuomailto:louxiantuo@outlook.com; Commentmailto:comment@noreply.github.com 主题: 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 发件人: xingE650mailto:notifications@github.com 发送时间: 2020年7月16日 15:24 收件人: gmayday1997/SceneChangeDetmailto:SceneChangeDet@noreply.github.com 抄送: louxiantuomailto:louxiantuo@outlook.com; Commentmailto:comment@noreply.github.com 主题: Re: [gmayday1997/SceneChangeDet] Strange Loss and not training? (#10https://github.com/gmayday1997/SceneChangeDet/issues/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)https://github.com/gmayday1997/SceneChangeDet/issues/10#issuecomment-659212632>, 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 GitHubhttps://github.com/gmayday1997/SceneChangeDet/issues/10#issuecomment-659279889, or unsubscribehttps://github.com/notifications/unsubscribe-auth/AETTUB2QEKQEM64ZK3SDEBDR33AEBANCNFSM4H6M6P6Q.

xingE650 commented 4 years ago

你之前说的ConstractiveLoss类中的forward方法,我去看了以下,他这个hhh和hhhh看不懂在哪里用到了。Loss不收敛的问题是如何解决的?我按照你的方式,添加了[cid:image003.png@01D65F6A.94E53630] 但是似乎没有效果 发送自 Windows 10 版邮件<https://go.microsoft.com/fwlink/?LinkId=550986>应用 发件人: xingE650mailto:notifications@github.com 发送时间: 2020年7月16日 17:13 收件人: gmayday1997/SceneChangeDetmailto:SceneChangeDet@noreply.github.com 抄送: louxiantuomailto:louxiantuo@outlook.com; Commentmailto:comment@noreply.github.com 主题: 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> 发件人: xingE650mailto:notifications@github.com 发送时间: 2020年7月16日 15:24 收件人: gmayday1997/SceneChangeDetmailto:SceneChangeDet@noreply.github.com 抄送: louxiantuomailto:louxiantuo@outlook.com; Commentmailto:comment@noreply.github.com 主题: 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 commented 4 years ago

好的,没关系,他这篇文章确实有一些奇怪。他们说有可能是pytorch版本问题。

发送自 Windows 10 版邮件https://go.microsoft.com/fwlink/?LinkId=550986应用

发件人: xingE650mailto:notifications@github.com 发送时间: 2020年7月21日 14:47 收件人: gmayday1997/SceneChangeDetmailto:SceneChangeDet@noreply.github.com 抄送: louxiantuomailto:louxiantuo@outlook.com; Commentmailto:comment@noreply.github.com 主题: Re: [gmayday1997/SceneChangeDet] Strange Loss and not training? (#10)

你之前说的ConstractiveLoss类中的forward方法,我去看了以下,他这个hhh和hhhh看不懂在哪里用到了。Loss不收敛的问题是如何解决的?我按照你的方式,添加了[cid:image003.png@01D65F6A.94E53630] 但是似乎没有效果 发送自 Windows 10 版邮件https://go.microsoft.com/fwlink/?LinkId=550986应用https://go.microsoft.com/fwlink/?LinkId=550986%3E%E5%BA%94%E7%94%A8 发件人: xingE650mailto:notifications@github.com 发送时间: 2020年7月16日 17:13 收件人: gmayday1997/SceneChangeDetmailto:SceneChangeDet@noreply.github.com 抄送: louxiantuomailto:louxiantuo@outlook.com; Commentmailto:comment@noreply.github.com 主题: Re: [gmayday1997/SceneChangeDet] Strange Loss and not training? (#10https://github.com/gmayday1997/SceneChangeDet/issues/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=550986https://go.microsoft.com/fwlink/?LinkId=550986%3E%E5%BA%94%E7%94%A8%5D(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:notifications@github.commailto:notifications@github.com 发送时间: 2020年7月16日 15:24 收件人: gmayday1997/SceneChangeDetmailto:SceneChangeDet@noreply.github.commailto:SceneChangeDet@noreply.github.com 抄送: louxiantuomailto:louxiantuo@outlook.commailto:louxiantuo@outlook.com; Commentmailto:comment@noreply.github.commailto:comment@noreply.github.com 主题: Re: [gmayday1997/SceneChangeDet] Strange Loss and not training? (#10https://github.com/gmayday1997/SceneChangeDet/issues/10<#10https://github.com/gmayday1997/SceneChangeDet/issues/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<#10https://github.com/gmayday1997/SceneChangeDet/issues/10 (comment)<#10 (comment)https://github.com/gmayday1997/SceneChangeDet/issues/10#issuecomment-659212632>>, or unsubscribehttps://github.com/notifications/unsubscribe-auth/AETTUB5AQ547HL6B6IKEDRTR32TJBANCNFSM4H6M6P6Q. 只是刚刚解决了loss过大不收敛的问题,因为作者的代码不支持多GPU,batch size>1,tensorboard可视化等功能,所以我还在修改代码,现在没办法回答您的问题。 D You are receiving this because you commented. Reply to this email directly, view it on GitHub<#10 (comment)https://github.com/gmayday1997/SceneChangeDet/issues/10#issuecomment-659279889>, or unsubscribehttps://github.com/notifications/unsubscribe-auth/AETTUB2QEKQEM64ZK3SDEBDR33AEBANCNFSM4H6M6P6Q.

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

― You are receiving this because you commented. Reply to this email directly, view it on GitHubhttps://github.com/gmayday1997/SceneChangeDet/issues/10#issuecomment-661669041, or unsubscribehttps://github.com/notifications/unsubscribe-auth/AETTUB5ZSX6NNMEOWZSVUSDR4U2YVANCNFSM4H6M6P6Q.

Vijayraven95 commented 3 years ago

你之前说的ConstractiveLoss类中的forward方法,我去看了以下,他这个hhh和hhhh看不懂在哪里用到了。Loss不收敛的问题是如何解决的?我按照你的方式,添加了[cid:image003.png@01D65F6A.94E53630] 但是似乎没有效果 发送自 Windows 10 版邮件<https://go.microsoft.com/fwlink/?LinkId=550986>应用 发件人: xingE650mailto:notifications@github.com 发送时间: 2020年7月16日 17:13 收件人: gmayday1997/SceneChangeDetmailto:SceneChangeDet@noreply.github.com 抄送: louxiantuomailto:louxiantuo@outlook.com; Commentmailto:comment@noreply.github.com 主题: 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:notifications@github.com 发送时间: 2020年7月16日 15:24 收件人: gmayday1997/SceneChangeDetmailto:SceneChangeDet@noreply.github.com 抄送: louxiantuomailto:louxiantuo@outlook.com; Commentmailto:comment@noreply.github.com 主题: 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).