Hi , I was trying to freeze some layers in a resnet and had a typo in my code
weights_v2 = ResNet50_Weights.IMAGENET1K_V2 resnet = resnet50(weights=weights_v2) for param in resnet.parameters(): param.requres_grad = True # typo here (should be requires_grad)
This code did not error out and I spent some time trying to figure out what was the issue, before I noticed the typo.
I realize that it’s possible to add attributes to tensors dynamically and hence there are no errors thrown.
Just sharing this in case someone runs into something similar.