Plant-Disease-Detection
Plant-Disease-Detection copied to clipboard
A question about CNN
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]).
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.