if you only do:
# we want to freeze the fc2 layer
net.fc2.weight.requires_grad = False
net.fc2.bias.requires_grad = False

without the second part does it still work? i.e. without:
optimizer = optim.SGD(filter(lambda p: p.requires_grad, net.parameters()), lr=0.1)