If you use a kernel_size of (1, 64), the associated weight for the kernel will be 4 Dimension (1, 64, 1, 64). This cannot be used to do a 1D convolution. Conv1D weights must be of dimension (out_channel x in_channel x kernel_size) - A 3D tensor.
Which is why you got the error.



 quoniammm:

RuntimeError: expected 3D tensor


Try changing the conv1d layer to
nn.Conv1d(in_channels = 64, out_channels = 1, kernel_size = 1)

This will produce a kernel of size (64 x 1 x 1). When convolved with an input of (1 x 64 x 3) will produce an output of (1x1x3)