RuntimeError: invalid argument 0: Sizes of tensors must match except in dimension 0. Got 1 and 0 in dimension 1

Hi there,
The problem comes from the fact that sometimes, your data augmentation will throw the point out of the image. There are three ways of dealing with it:

  • lowering your params of data augmentation
  • writing a collate function that will pad your points when they’re empty to make them the right size
  • using ImagePoints with remove_out=False to keep the points even if they’re out (and making the model guess from the part of the picture it can see).
5 Likes