Hi,I’ve encountered this problem before.
You can use chain to put your model parameters together just following this code:
from itertools import chain
parameters = chain(mainnet.parameters(),subnet.parameters())
optimizer = optim.SGD(parameters, lr=0.01, momentum=0.9)