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

Error in During testing the model need the number of output to perform testing? #18

Closed
Aliktk opened this issue Jun 8, 2021 · 1 comment

Comments

@Aliktk
Copy link

Aliktk commented Jun 8, 2021

I am running test file to validate the results.
The data loaded and preprocess sucessfully and when I load model with out_size as given in code to 8 its says the below erorr?
What is the solution?
Did the code need to update?
or model in the Pytorch are missing something.

File "C:\ProgramData\Anaconda3\envs\chest-loc\lib\site-packages\torchvision\models\densenet.py", line 98, in init layer = _DenseLayer(num_input_features + i * growth_rate, growth_rate, bn_size, drop_rate) File "C:\ProgramData\Anaconda3\envs\chest-loc\lib\site-packages\torchvision\models\densenet.py", line 77, in init self.add_module('norm.1', nn.BatchNorm2d(num_input_features)), File "C:\ProgramData\Anaconda3\envs\chest-loc\lib\site-packages\torch\nn\modules\module.py", line 178, in add_module raise KeyError("module name can't contain "."") KeyError: 'module name can't contain "."'
Help me in this regard.
Thanks
@thtang

@Aliktk Aliktk closed this as completed Jun 8, 2021
@Aliktk
Copy link
Author

Aliktk commented Jun 8, 2021

by changing the

# model.load_state_dict(torch.load("model/DenseNet121_aug4_pretrain_WeightBelow1_1_0.829766922537.pkl"))
state_dict =torch.load("model/DenseNet121_aug4_pretrain_WeightBelow1_1_0.829766922537.pkl") 

as mentioned in #8

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

1 participant