awesome_lightweight_networks
awesome_lightweight_networks copied to clipboard
einops.EinopsError
import torch from light_cnns import mobilevit_s model = mobilevit_s() model.eval() print(model) input = torch.randn(1, 3, 224, 224) y = model(input) print(y.size()) 这段代码输入报错:einops.EinopsError: Error while processing rearrange-reduction pattern "b d (h ph) (w pw) -> b (ph pw) (h w) d". Input tensor shape: torch.Size([1, 240, 7, 7]). Additional info: {'ph': 2, 'pw': 2}. Shape mismatch, can't divide axis of length 7 in chunks of 2
修改为(1, 3, 256, 256)才好