vincentherrmann / pytorch-wavenet

An implementation of WaveNet with fast generation
MIT License
968 stars 225 forks source link

The size of tensor a (4) must match the size of tensor b (2) at non-singleton dimension 0 #32

Open denadai2 opened 4 years ago

denadai2 commented 4 years ago
--> 172             skip = s + skip
     173 
     174             x = self.residual_convs[i](x)

     RuntimeError: The size of tensor a (4) must match the size of tensor b (2) at non-singleton dimension 0

I have this error I don't understand. In your code, dilations might increase the first dimension of the x, which is usually the batch size. Ok. However, this sometimes raise an errror on the skip connections, as in this case a vector [4, 1024, 1] is added to a vector [2, 1024, 1]. Why?

sunyasheng commented 4 years ago

@denadai2 I met the same error, have you figured out why?