CheXNet icon indicating copy to clipboard operation
CheXNet copied to clipboard

I can't run code. Can anyone help me

Open BrQKarkac opened this issue 7 months ago • 1 comments

When I download and run the code I get the following error. I get the same error when I try to run it on COLAB. I didn't understand the problem and I couldn't solve it

C:\Users\BrQ\AppData\Local\Programs\Python\Python39\python.exe C:\Users\BrQ\Desktop\COLAB\CheXNet-master\model.py C:\Users\BrQ\AppData\Local\Programs\Python\Python39\lib\site-packages\torchvision\models_utils.py:208: UserWarning: The parameter 'pretrained' is deprecated since 0.13 and may be removed in the future, please use 'weights' instead. warnings.warn( C:\Users\BrQ\AppData\Local\Programs\Python\Python39\lib\site-packages\torchvision\models_utils.py:223: UserWarning: Arguments other than a weight enum or None for 'weights' are deprecated since 0.13 and may be removed in the future. The current behavior is equivalent to passing weights=DenseNet121_Weights.IMAGENET1K_V1. You can also use weights=DenseNet121_Weights.DEFAULT to get the most up-to-date weights. warnings.warn(msg) => loading checkpoint Traceback (most recent call last): File "C:\Users\BrQ\Desktop\COLAB\CheXNet-master\model.py", line 129, in main() File "C:\Users\BrQ\Desktop\COLAB\CheXNet-master\model.py", line 40, in main model.load_state_dict(checkpoint['state_dict']) File "C:\Users\BrQ\AppData\Local\Programs\Python\Python39\lib\site-packages\torch\nn\modules\module.py", line 2189, in load_state_dict raise RuntimeError('Error(s) in loading state_dict for {}:\n\t{}'.format( RuntimeError: Error(s) in loading state_dict for DataParallel: Missing key(s) in state_dict: "module.densenet121.features.denseblock1.denselayer1.norm1.weight", "module.densenet121.features.denseblock1.denselayer1.norm1.bias", "module.densenet121.features.denseblock1.denselayer1.norm1.running_mean", "module.densenet121.features.denseblock1.denselayer1.norm1.running_var", .... "module.densenet121.features.denseblock1.denselayer1.conv1.weight", "module.densenet121.features.denseblock1.denselayer1.norm2.weight", "module.densenet121.features.denseblock1.denselayer1.norm2.bias", "module.densenet121.features.denseblock1.denselayer1.norm2.running_mean", "module.densenet121.features.denseblock1.denselayer1.norm2.running_var", "module.densenet121.features.denseblock1.denselayer1.conv2.weight", "module.densenet121.features.denseblock1.denselayer2.norm1.weight", "module.densenet121.features.denseblock1.denselayer2.norm1.bias", "module.densenet121.features.denseblock1.denselayer2.norm1.running_mean", "module.densenet121.features.denseblock4.denselayer16.norm.2.running_mean", "module.densenet121.features.denseblock4.denselayer16.norm.2.running_var", "module.densenet121.features.denseblock4.denselayer16.conv.2.weight".

Process finished with exit code 1

BrQKarkac avatar Jul 29 '24 07:07 BrQKarkac