The in_features depend on the shape of your input, so what could be done is to set the input shape as an argument, pass a random tensor through the conv layers, get the shape and initialize the linear layers using this shape.
That’s basically the automatic way of passing an input through your model, print the shape right before the linear layer and set the right in_features afterwards. At least that’s my workflow, if I’m too lazy to calculate the shape.