Based on the print statements, you should set in_features=7168.
However, I’m not sure if your model is really doing what you intend to do.
nn.Conv2d expects an input tensor in the shape [batch_size, channels, height, width], while you are apparently passing the tensor as [batch_size, height, width, channels] and set the number of input channels to 224, which seems to be the height.
You could permute the input tensor via: x = x.permute(0, 3, 1, 2) and pass it in the expected shape.
PS: It’s also better to post by wrapping it in three backticks ```, as it makes debugging easier and enables the forum search.