The issue is that assuming an input x of shape (N,1,H_in) is fed to your fc_encoder, you get an output of shape (N,1,H_out). This shape is then feasible to be fed into your Conv1d layer. However, it seems the shape of the tensor being fed into this layer is [1, 4975]. So, please ensure your input is shaped (N, 1, H_in).