Solved by darleybarreto in post #2 
              
              
                I found the error. Before the last Conv2d, my tensor had shape torch.Size([8, 128, 2, 2]), then when it goes to the last Conv2d it crashes. So I am not using the two last convs.