Is it possible to freeze only the first basic block of sequential layers (layer 1) in a ResNet model?
model=models.resnet18(pretrained=True)
num_ftrs = model.fc.in_features
model.fc = nn.Linear(num_ftrs, 2)
child_counter = 0
for child in model.children():
    if child_counter < 4:
        print("child ",child_counter," was frozen")
        for param in child.parameters():
            param.requires_grad = False
    elif child_counter == 4:
      children_of_child_counter = 0
      for children_of_child in child.children():
          if children_of_child_counter < 1:
              for param in child.parameters():                
                  param.requires_grad = False
              print('child ', children_of_child_counter, 'of child',child_counter,' was frozen')
          else:
            print('child ', children_of_child_counter, 'of child',child_counter,' was not frozen')
          children_of_child_counter += 1
    else:
      print("child ",child_counter," was not frozen")
    child_counter += 1         
summary(model, (3, 224, 224))

The print statement is ok. However, in summary, it is shown that the whole Layer1 is freezing.
Please help.
Thanks in advance.