mmsegmentation icon indicating copy to clipboard operation
mmsegmentation copied to clipboard

AttributeError: 'list' object has no attribute 'shape' using PIDNet

Open alejandrogarcia11 opened this issue 1 year ago • 2 comments

Hello, I'm training PIDNet and instead of having a tensor of dimensions (B, C, H, W), I have a 2 lists of (C, H, W)... I don´t know if this is a bug or it's my fault. The error comes at the first part of the 'forward' function:

def forward(self, x: Tensor) -> Union[Tensor, Tuple[Tensor]]:
    """Forward function.

    Args:
        x (Tensor): Input tensor with shape (B, C, H, W).

    Returns:
        Tensor or tuple[Tensor]: If self.training is True, return
            tuple[Tensor], else return Tensor.
    """
    w_out = x.shape[-1] // 8
    h_out = x.shape[-2] // 8

    ....

Thanks!

alejandrogarcia11 avatar Feb 15 '24 09:02 alejandrogarcia11

Some of the models have this randomly for some reason in my experience I don't know how to fix this.

jacksteussie avatar Mar 28 '24 16:03 jacksteussie

same problem, nobody knows the solution?

lurenzhouyi avatar Jul 04 '24 16:07 lurenzhouyi