zoogzog / chexnet

Implementation of the CheXNet network (PyTorch)
211 stars 94 forks source link

question about the 'model.load_state_dict(checkpoint['state_dict'])', #17

Open siyusa opened 5 years ago

siyusa commented 5 years ago

when I run the code,the result is like this :Missing key(s) in state_dict: "module.densenet121.features.denseblock1.denselayer1.......' I have been suffering with this problem for a week ,could you please help me ,I will appreciate very much.Looking forward to hearing from you

YakinRubaiat commented 5 years ago

I modified the heatmap code like this, it can process the state_dict correctly, https://github.com/YakinRubaiat/chexnet/blob/ceb92ba7e43d646e9b51bcae77e647ba40ac8b59/HeatmapGenerator.py#L42

AtulCIS commented 4 years ago

Hi @YakinRubaiat , I am also getting the same error and I could not access the file HeatmapGenerator.py added by you

yuyijie1995 commented 4 years ago

I met the same question , are you solved it?

egenc commented 3 years ago

just change the line model.load_state_dict(modelCheckpoint['state_dict']) to model.load_state_dict(modelCheckpoint['state_dict'], False)