yizt / Grad-CAM.pytorch

pytorch实现Grad-CAM和Grad-CAM++,可以可视化任意分类网络的Class Activation Map (CAM)图,包括自定义的网络;同时也实现了目标检测faster r-cnn和retinanet两个网络的CAM图;欢迎试用、关注并反馈问题...
Apache License 2.0
730 stars 167 forks source link

CenterNet:objects as points应该如何实现grad-cam? #28

Open wangminj opened 4 years ago

wangminj commented 4 years ago

您好,请问CenterNet:objects as points网络可以实现grad-cam吗?应该如何实现呢?

yizt commented 3 years ago

@wangminj 您好,可以直接在中心点这个keypoint上做梯度反向传播

guohaoyuan commented 3 years ago

请问各位小伙伴,实现了CenterNet object as points的grad-cam了嘛?

yizt commented 3 years ago

@guohaoyuan 这个没有实现,有空尽快实现,大家也可以自己实现,遇到问题互相交流

DreamRiverForever commented 3 years ago

您好,请问CenterNet:objects as points网络可以实现grad-cam吗?应该如何实现呢?

你好,请问你实现了centernet的grad-cam吗?

Fly-dream12 commented 3 years ago

在detectron2架构上的centernet进行grad_cam实现时候总是获取不到梯度,是否在score.backward()可以成功运行时候才会执行_register_hook里面的_get_grads_hook呢? 我这里score是个常量无法反传.望博主指点 @yizt

yizt commented 3 years ago

@Fly-dream12 请问在detectron2架构上的centernet指的哪个工程?

Fly-dream12 commented 3 years ago

@yizt centerX 我在提供的detectron2 faster_rcnn中也尝试了,也获取不到梯度.

yizt commented 3 years ago

@Fly-dream12 测试的图片麻烦提供下,faster_rcnn是否有改动,测试命令麻烦提供下,麻烦尽量信息到能够复现问题的粒度

Fly-dream12 commented 3 years ago

你好 我发邮箱了 @yizt

Fly-dream12 commented 3 years ago

有改动 按照你提示的改的.

在 2021-05-26 10:21:58,"mick.yi" @.***> 写道:

@Fly-dream12 测试的图片麻烦提供下,faster_rcnn是否有改动,测试命令麻烦提供下,麻烦尽量信息到能够复现问题的粒度

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub, or unsubscribe.

yizt commented 3 years ago

@Fly-dream12 感谢您的反馈,我实现的是faster r-cnn,只需要知道第几个proposal就可以了;您用的faster_rcnn_R_101_FPN_base属于FPN,FPN还需要定位proposal是哪一层feature map生成的;faster r-cnn目前直接用的最后一层feature map

Fly-dream12 commented 3 years ago

恩恩 是这样的 但是为什么获取不到梯度呢

At 2021-05-26 11:50:25, "mick.yi" @.***> wrote:

@Fly-dream12 感谢您的反馈,我实现的是faster r-cnn,只需要知道第几个proposal就可以了;您用的faster_rcnn_R_101_FPN_base属于FPN,FPN还需要定位proposal是哪一层feature map生成的;faster r-cnn目前直接用的最后一层feature map

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub, or unsubscribe.

yizt commented 3 years ago

@Fly-dream12 需要定位proposal是哪一层feature map生成的,不能直接用最后一层的feature map

yizt commented 3 years ago

@Fly-dream12 请把代码改动贴上来

Fly-dream12 commented 3 years ago

This is the error
gradient = self.gradient[proposal_idx].cpu().data.numpy() # [C,H,W] TypeError: 'NoneType' object is not subscriptable @yizt

dodeokwangyooo commented 3 years ago

请问大伙儿实现centernet的CAM图了吗

dodeokwangyooo commented 3 years ago

@Fly-dream12 请把代码改动贴上来 请问一下作者实现Centernet的gradcam了吗,尝试许久还是没有成功