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

A question about CNN #11

Open
dinhan92 opened this issue Aug 5, 2023 · 1 comment
Open

A question about CNN #11

dinhan92 opened this issue Aug 5, 2023 · 1 comment

Comments

@dinhan92
Copy link

dinhan92 commented Aug 5, 2023

When I add more data to the dataset disease_info (more items about Apple Scab), should I change this 39 to more?
model = CNN.CNN(39)
for example if I add 6 more item in disease_info, should I change 39 to 45 ?
When I do that, I meet this error:
RuntimeError: Error(s) in loading state_dict for CNN:
size mismatch for dense_layers.4.weight: copying a param with shape torch.Size([39, 1024]) from checkpoint, the shape in current model is torch.Size([45, 1024]).
size mismatch for dense_layers.4.bias: copying a param with shape torch.Size([39]) from checkpoint, the shape in current model is torch.Size([45]).

@manthan89-py
Copy link
Owner

You need to update the CNN model and need to train the model again with 45 different categories. You might need to change some other places where the number of categories is hard coded.

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