zhoubolei / CAM

Class Activation Mapping
http://cnnlocalization.csail.mit.edu/
MIT License
1.85k stars 467 forks source link

minor bug in pytorch code? #25

Closed isht7 closed 6 years ago

isht7 commented 6 years ago

I am using this script in pytorch available in your repository. Currently, this line is cam = weight_softmax[class_idx].dot(feature_conv.reshape((nc, h*w))) But I think it should be, cam = weight_softmax[idx].dot(feature_conv.reshape((nc, h*w)))

class_idx should be replaced by idx, becuase class_idx is a list, idx is a integer.

DesertsP commented 6 years ago

I agree.

zhoubolei commented 6 years ago

Thanks. Fixed.

isht7 commented 6 years ago

Thanks.