resnet18 doesn’t have a classifier field, and the solution I gave was for vgg.
resnet18
classifier
vgg