hi,
im having a similar problam with avgpool1d:
this is code:
self.bn1 = nn.BatchNorm2d(64)
self.layer1 = self._make_layer(block, 64, num_blocks[0], stride=1)
self.layer2 = self._make_layer(block, 128, num_blocks[1], stride=2)
self.layer3 = self._make_layer(block, 256, num_blocks[2], stride=2)
self.layer4 = self._make_layer(block, 512, num_blocks[3], stride=2)
if (self.extraClasses == 1 or extraLayer == 1) and extraFeat == False:
self.linear = nn.Linear(512 * block.expansion, num_classes)
if self.pool:
self.scores =  nn.AvgPool1d(2, stride=2)
def forward(self, x):
out = F.relu(self.bn1(self.conv1(x)))
cnnOut = out
layer1 = self.layer1(out)
layer2 = self.layer2(layer1)
layer3 = self.layer3(layer2)
layer4 = self.layer4(layer3)
    out = F.avg_pool2d(layer4, 4)
    out = out.view(out.size(0), -1)
    featureLayer = out
    pool = 0
    if self.extraClasses == 1:
        out = self.linear(out)
        if self.pool:
            pool = self.scores(out)

in the attempt of calculating the pooling, i get the following:
RuntimeError: Expected 3-dimensional tensor, but got 2-dimensional tensor for argument #1 ‘self’ (while checking arguments for avg_pool1d)
thanks!