@apaszke. But one more question, resnet18 has not got features attribute.
here is my code:

li = resnet.features.parameters()

and here is its error:


AttributeError                            Traceback (most recent call last)
 in ()
----> 1 li = resnet.features.parameters()


/home/mohammad/anaconda3/lib/python3.6/site-packages/torch/nn/modules/module.py in getattr(self, name)
241             if name in modules:
242                 return modules[name]
–> 243         return object.getattribute(self, name)
244
245     def setattr(self, name, value):


AttributeError: ‘ResNet’ object has no attribute ‘features’