ppengtang / pcl.pytorch

PyTorch codes for our papers "Multiple Instance Detection Network with Online Instance Classifier Refinement" and "PCL: Proposal Cluster Learning for Weakly Supervised Object Detection".
MIT License
253 stars 48 forks source link

Code added attention module error #69

Closed hpu-dxx closed 2 years ago

hpu-dxx commented 2 years ago

Hello, thank you very much for your code.I would like to add attention module to the feature extraction network vGG16 section.I found that when I focused on the last edge of VGG16, it worked.But I added attention in the middle CONV layer of VGG16, no problem in the training phase, I can train the model parameter file, but the test result is always 0.I suspect it's the test code that needs to be changed, but I don't know where. Can you tell me? Thank you very much.

ppengtang commented 2 years ago

Hi, I think we only need to change https://github.com/ppengtang/pcl.pytorch/blob/master/lib/modeling/vgg16.py to change the model architecture.

hpu-dxx commented 2 years ago

Hi, I think we only need to change https://github.com/ppengtang/pcl.pytorch/blob/master/lib/modeling/vgg16.py to change the model architecture.

Thank you very much for your reply. I added THE SE attention module between THE CONV layers of VGG, and the trained model had no problem. However, map=0 occurred during the test. There was a problem when loading the training model during the test, but I could not find the problem. Can you give me some advice?

jianghuaiju commented 2 years ago

@hpu-dxx 你好,你解决这个问题了吗?

hpu-dxx commented 2 years ago

@hpu-dxx 你好,你解决这个问题了吗? 你在添加注意力模块的时候,应该注意detectron_weight_mapping函数

jianghuaiju commented 2 years ago

@hpu-dxx 嗯嗯,请问你加了过后,效果提升了吗?

hpu-dxx commented 2 years ago

@hpu-dxx 嗯嗯,请问你加了过后,效果提升了吗?

我加的senet没有提升

jianghuaiju commented 2 years ago

@hpu-dxx 那我不加了,谢谢你的回复

jianghuaiju commented 2 years ago

@hpu-dxx 请问你有试过cbam吗,我看作者加过,不知道效果怎么样?

hpu-dxx commented 2 years ago

作者加过CBAM模块吗?你可以试试,我还没试过

jianghuaiju commented 2 years ago

@ppengtang @hpu-dxx 作者在他19年的论文里加过

hpu-dxx commented 2 years ago

@ppengtang @hpu-dxx 作者在他19年的论文里加过

可以分享一下是哪一篇论文吗?谢谢

jianghuaiju commented 2 years ago

@hpu-dxx Towards Precise End-to-End Weakly Supervised Object Detection Network,作者在里面用了cbam,但是这里的代码却没有使用, @ppengtang 能说下你为什么不使用的原因吗

zhenwenYANG commented 2 years ago

你好,能不能让我看看你的senet怎么加的,我在实施的过程中detectron_weight_mapping函数一直报错TT

hpu-dxx commented 2 years ago

你好,能不能让我看看你的senet怎么加的,我在实施的过程中detectron_weight_mapping函数一直报错TT

加的话不难,因为senet是即插即用的,主要是detectron_weight_mapping函数和utils里边的convert_state_dict函数内容要和你加senet后的网络对应上。你如果不确定,你可以把加过senet的model输出一下,然后在这两个函数里边看看哪里需要改一下。

zhenwenYANG commented 2 years ago

我是个pytorch小白,代码能力不太行,你有没有加好的代码,能让我看看学习学习嘛?感谢感谢TT

发送

------------------ 原始邮件 ------------------ 发件人: "ppengtang/pcl.pytorch" @.>; 发送时间: 2022年9月26日(星期一) 下午4:18 @.>; @.**@.>; 主题: Re: [ppengtang/pcl.pytorch] Code added attention module error (Issue #69)

你好,能不能让我看看你的senet怎么加的,我在实施的过程中detectron_weight_mapping函数一直报错TT

加的话不难,因为senet是即插即用的,主要是detectron_weight_mapping函数和utils里边的convert_state_dict函数内容要和你加senet后的网络对应上。你如果不确定,你可以把加过senet的model输出一下,然后在这两个函数里边看看哪里需要改一下。

— Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you commented.Message ID: @.***>

hpu-dxx commented 2 years ago

我是个pytorch小白,代码能力不太行,你有没有加好的代码,能让我看看学习学习嘛?感谢感谢TT 发送 ------------------ 原始邮件 ------------------ 发件人: "ppengtang/pcl.pytorch" @.>; 发送时间: 2022年9月26日(星期一) 下午4:18 @.>; @.**@.>; 主题: Re: [ppengtang/pcl.pytorch] Code added attention module error (Issue #69) 你好,能不能让我看看你的senet怎么加的,我在实施的过程中detectron_weight_mapping函数一直报错TT 加的话不难,因为senet是即插即用的,主要是detectron_weight_mapping函数和utils里边的convert_state_dict函数内容要和你加senet后的网络对应上。你如果不确定,你可以把加过senet的model输出一下,然后在这两个函数里边看看哪里需要改一下。 — Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you commented.Message ID: @.***>

很抱歉,这是我去年的代码,代码在实验室的服务器上,很久没用了。你可以去CSDN搜一下,有博主讲解怎么添加注意力模块的。

zhenwenYANG commented 2 years ago

好的,感谢感谢

------------------ 原始邮件 ------------------ 发件人: "ppengtang/pcl.pytorch" @.>; 发送时间: 2022年9月26日(星期一) 下午4:35 @.>; @.**@.>; 主题: Re: [ppengtang/pcl.pytorch] Code added attention module error (Issue #69)

我是个pytorch小白,代码能力不太行,你有没有加好的代码,能让我看看学习学习嘛?感谢感谢TT 发送 … ------------------�0�2原始邮件�0�2------------------ 发件人: "ppengtang/pcl.pytorch" @.>; 发送时间:�0�22022年9月26日(星期一) 下午4:18 @.>; @.@.>; 主题:�0�2Re: [ppengtang/pcl.pytorch] Code added attention module error (Issue #69) 你好,能不能让我看看你的senet怎么加的,我在实施的过程中detectron_weight_mapping函数一直报错TT 加的话不难,因为senet是即插即用的,主要是detectron_weight_mapping函数和utils里边的convert_state_dict函数内容要和你加senet后的网络对应上。你如果不确定,你可以把加过senet的model输出一下,然后在这两个函数里边看看哪里需要改一下。 — Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you commented.Message ID: @.***>

很抱歉,这是我去年的代码,代码在实验室的服务器上,很久没用了。你可以去CSDN搜一下,有博主讲解怎么添加注意力模块的。

— Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you commented.Message ID: @.***>

zhenwenYANG commented 1 year ago

你好,你有没有在voc2012上面测试呀?好像得传到服务器上才能得到在voc2012数据集上的结果哎

hpu-dxx commented 1 year ago

VOC2012的测试确实是需要上传到服务器网站才能看到检测结果。你可以去CSDN或者知乎搜一下目标检测任务中VOC2012的使用方法。

 

------------------ 原始邮件 ------------------ 发件人: "ppengtang/pcl.pytorch" @.>; 发送时间: 2022年12月2日(星期五) 中午11:14 @.>; @.**@.>; 主题: Re: [ppengtang/pcl.pytorch] Code added attention module error (Issue #69)

你好,你有没有在voc2012上面测试呀?好像得传到服务器上才能得到在voc2012数据集上的结果哎

— Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you were mentioned.Message ID: @.***>

zhenwenYANG commented 1 year ago

好的,谢谢你~~

GD @.***

------------------ 原始邮件 ------------------ 发件人: "ppengtang/pcl.pytorch" @.>; 发送时间: 2022年12月2日(星期五) 中午11:19 @.>; @.**@.>; 主题: Re: [ppengtang/pcl.pytorch] Code added attention module error (Issue #69)

VOC2012的测试确实是需要上传到服务器网站才能看到检测结果。你可以去CSDN或者知乎搜一下目标检测任务中VOC2012的使用方法。

 

------------------ 原始邮件 ------------------ 发件人: "ppengtang/pcl.pytorch" @.>; 发送时间: 2022年12月2日(星期五) 中午11:14 @.>; @.**@.>; 主题: Re: [ppengtang/pcl.pytorch] Code added attention module error (Issue #69)

你好,你有没有在voc2012上面测试呀?好像得传到服务器上才能得到在voc2012数据集上的结果哎

— Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you were mentioned.Message ID: @.> — Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you commented.Message ID: @.>