Model throws error on input size when its last layer is removed

also, yuour sequential would be missing .view, as you correctly point out :slight_smile:

why do we need a view?

the convolution layers have tensors in layout something like (N,C,H,W), where:

  • N => batchsize
  • C => number of channels/features
  • H => height of each image
  • W => width of each image

The fc layers work on much more ‘squished’ dimensinos, something more ike (N, C):

  • N => batchsie
  • C => number of features/neurons

The view converts from one layout t o another