LilitYolyan / CutPaste

Unofficial implementation of Google "CutPaste: Self-Supervised Learning for Anomaly Detection and Localization" in PyTorch
MIT License
114 stars 25 forks source link

Getting problem when using ResNet50 #26

Open sarmientoj24 opened 2 years ago

sarmientoj24 commented 2 years ago

Getting problems on this.

    return torch._C._nn.linear(input, weight, bias)
RuntimeError: mat1 and mat2 shapes cannot be multiplied (12x2048 and 512x512)

I am getting this error with the ff command

python train.py --dataset_path ../data/train --encoder resnet50 --pretrained --num_gpus 1

My ../data/train is just composed of jpg images.

I would just want to do self-supervised pretraining without annotations/labels.

Seems like it has soemthing to do with this dims

    def __init__(self, encoder='resnet18', pretrained=True, dims=[512, 512, 512, 512, 512, 512, 512, 512, 128], num_class=3):

What would be the dims for resnet50?

wfz2200220105 commented 2 years ago

Getting problems on this.

    return torch._C._nn.linear(input, weight, bias)
RuntimeError: mat1 and mat2 shapes cannot be multiplied (12x2048 and 512x512)

I am getting this error with the ff command

python train.py --dataset_path ../data/train --encoder resnet50 --pretrained --num_gpus 1

My ../data/train is just composed of jpg images.

I would just want to do self-supervised pretraining without annotations/labels.

Seems like it has soemthing to do with this dims

    def __init__(self, encoder='resnet18', pretrained=True, dims=[512, 512, 512, 512, 512, 512, 512, 512, 128], num_class=3):

What would be the dims for resnet50?

Which layer is the network of feature extraction, is the result of that layer