You just need to make requires_grad=False for the both the input and the layer1 layers once at the 10th epoch.
for p in model.parameters():
    p.requires_grad = True
for epoch in number_of_epochs:
    if epoch == 10 : 
         for p in model.input.parameters():
             p.requires_grad = False
         for q in model.layer1.parameters():
             q.requires_grad = False

This should work.