JDE65:

But I get the double problem of rejection of the average pooling


Could you explain, what error you are seeing in this pooling layer?
Also, I’m not sure what the issue with the Conv1d weight matrix is. Do you think its shape is unexpected somehow?
The shape mismatch error after removing the polling layer is raised, since the features of the incoming activation don’t match the in_features of the linear layer.
You could print the activation with a custom module inside the nn.Sequential container and adapt the in_features. However, I think it would be better to solve the pooling issue first.