Freeze the learnable parameters of resnet and attach it to a new network
I would like to know is this approach correct or not? Actually, in my point of view, only the 6 or 8 last layers have learnable parameters. Am I right?
mderakhshani
apaszke
mderakhshani
<SCODE>for param in net.features.parameters():
    param.requires_grad = False
<ECODE>
apaszke
mderakhshani
and here is its error:
mderakhshani
albanD
mderakhshani
My code: Error:
mderakhshani
<SCODE>parameters = ifilter(lambda p: p.requires_grad, net.parameters())
<ECODE>
albanD
mderakhshani
albanD
apaszke
I am wondering whether to set .eval() for those frozen layers since they may still update their running mean and running var during training while not learning their parameters.
James_Chen