Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

I can't run code. Can anyone help me #47

Open
BrQKarkac opened this issue Jul 29, 2024 · 1 comment
Open

I can't run code. Can anyone help me #47

BrQKarkac opened this issue Jul 29, 2024 · 1 comment

Comments

@BrQKarkac
Copy link

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

@Asaad-Pak
Copy link

@BrQKarkac have you extracted the checkpoint from model.pth.tar file successfully?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants