You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi @zoogzog
Thanks for writing everything. This has been really helpful. However, when I was reading the code for the visualization, I realized that there is a bug in the code:
self.model=model.module.densenet121.featuresself.model.eval()
#---- Initialize the weightsself.weights=list(self.model.parameters())[-2]
Once you have assigned densenet121.features to self.model, it loses the weights of the final classification layer and we need those weights for calculating CAM. Instead you are using weights from some part of densenet121.features, which gives rise to the error in visualization. I've already made the change and added a few other things that improved my visualization, taken from https://github.com/jrzech/reproduce-chexnet here: https://github.com/dalmia/chexnet/blob/master/HeatmapGenerator.py
I tried creating a Pull Request but apparently it cannot detect any difference between our repos.
The text was updated successfully, but these errors were encountered:
Hi @zoogzog
Thanks for writing everything. This has been really helpful. However, when I was reading the code for the visualization, I realized that there is a bug in the code:
Once you have assigned
densenet121.features
toself.model
, it loses the weights of the final classification layer and we need those weights for calculating CAM. Instead you are using weights from some part ofdensenet121.features
, which gives rise to the error in visualization. I've already made the change and added a few other things that improved my visualization, taken from https://github.com/jrzech/reproduce-chexnet here: https://github.com/dalmia/chexnet/blob/master/HeatmapGenerator.pyI tried creating a Pull Request but apparently it cannot detect any difference between our repos.
The text was updated successfully, but these errors were encountered: