Plant-Disease-Detection icon indicating copy to clipboard operation
Plant-Disease-Detection copied to clipboard

A question about CNN

Open dinhan92 opened this issue 2 years ago • 1 comments

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]).

dinhan92 avatar Aug 05 '23 03:08 dinhan92

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.

manthan89-py avatar Mar 08 '24 10:03 manthan89-py