This is because there is no module in the pre-trained model named as features. “features” is one of the modules of VGG(the initial example of this thread). To see the module names, just simple print your model.
my_model = models.ResNet18(pre_trained = False, progressed =True)
print(my_model)