failed to train deep learning model

551
3
04-03-2023 12:31 PM
KuenzangNamgay
New Contributor

 

I have been trying to train pre-trained model for building footprint area extraction model. I have been stuck with a error and stuck for week. If anyone could help me ,I would be grateful.

Following are error message

Runtime Error:Error(s) in loading state_dict for MaskRCNN:
size mismatch for backbone.body.conv1.weight: copying a param with shape torch.Size([64, 3, 7, 7]) from checkpoint, the shape in current model is torch.Size([64, 4, 7, 7]).Training not successful

0 Kudos
3 Replies
_Cartographer_
New Contributor II

Hi, did you ever figure this out? I am trying to train the same building footprint model and keep getting various "size mismatch" errors as well. 

0 Kudos
K3H
by
New Contributor

Hi, I encountered a similar error message and realized it was because the raster I entered had 4 bands, switching to a 3 band jpeg solved it, hope this helps

0 Kudos
Sherbert1848
New Contributor

I was having the same issue. I believe the problem originates with the training data raster having too many bands. The model apparently only accepts a 3-band raster, while I was originally working with a 4-band raster. I used the Extract Band function to pair down my original raster and then re-exported the training data. This seems to have solved the problem. 

0 Kudos