PaDiM-Anomaly-Detection-Localization-master icon indicating copy to clipboard operation
PaDiM-Anomaly-Detection-Localization-master copied to clipboard

about embedding concat

Open chengweige opened this issue 4 years ago • 3 comments

layer1 ~ layer3 have different feature map size, so how to concate embedding from layer1 ~ layer3? i can't find it from the paper

chengweige avatar Feb 20 '21 09:02 chengweige

layer1 ~ layer3 have different feature map size, so how to concate embedding from layer1 ~ layer3? i can't find it from the paper

The concatenation function is defined here: https://github.com/xiahaifeng1995/PaDiM-Anomaly-Detection-Localization-master/blob/65adb9c461017e542b09b08042e21e606a8f8977/main.py#L286

You could also use torch.nn.functional.interpolate(input, scale_factor=2, mode='nearest') as you like.

plutoyuxie avatar Feb 24 '21 01:02 plutoyuxie

Hello Have any one got this error x = x.view(B, C1, -1, H2, W2) RuntimeError: shape '[20, 256, -1, 50, 50]' is invalid for input of size 200724480

Omarelsaadany avatar Aug 27 '21 14:08 Omarelsaadany

@Omarelsaadany. you need to change your input image size, as with your current input image size there is an dimension error. 200724480/(20x256x50x50) is a float number and not an integer The dimension "-1" is a PyTorch alias for "infer this dimension given the others have all been specified" (i.e. the quotient of the original product by the new product)

bjaeger1 avatar Feb 17 '22 08:02 bjaeger1