The shapes are a bit weird, as the linear layer is raising the error, however conv3 should also not work, as the kernel size of 5 is bigger than the spatial size of its input (3x3).
Are you sure these shapes are the output shapes of conv1 and conv2, as they seem to be the output shapes of conv2 and conv3, which would also match the input shape.
Anyway, the input features of head should be 32*3*3=288.
If your training was working, it seems that you’ve changed the input shape for testing the model?