[HELP] convert TensorFlow convolutional layer into PyTorch

Hi have this layer written in python with the TensorFlow library:

       (3, 6), 
       strides=(1, 1), 
       input_shape= (10, 6, 1), 

and I’m trying to convert it into PyTorch, for now what i achieved is this:

self.conv2d = nn.Sequential(
                nn.Conv2d(1, 1, (3,6), (1, 1)),

The problem is that in the TF implementation i have as output dimension [None, 8, 1, 64] and in PyTorch [-1, 1, 8, 1] so i think that the last 1 should be 64. This is even validated by the number of parameters that i have in TF and PyTorch respectively: 1216 and 19.
(19*64 = 1216)

Am I missing something?

Set output channels to 64.

self.conv2d = nn.Sequential(
                nn.Conv2d(1, 64, (3,6), (1, 1)),

In pytorch channel dimension is second not last

You can check the tutorial for PyTorch.

ok, I’m trying with that, now i have some problems with the input, I’ll check to solve this and I’ll update you. Thanks

can you link it to me please?


Scroll here, lots of material

and thanks for the clarification, this is helping me a lot on understanding conditionality on pytorch.