I split the pretrained VGG into slices.They are called slice1,slice2,slice3 and so on.But when I want to set some parts freezed while other trained.I can’t match these model by name.I tried to use
for i in range(1,6):
self.'slice{:d}.'format(i).parameters()
this doesn’t work.How to modify?