Hi Amine,
Are you using Python 2? Because since Python 3.5 starred expressions have been generalized so that named expressions can be used afterwards (PEP 448).
A Python 2 compatible workaround could be:
self.classifier = nn.Sequential(
    *[list(model.classifier.children())[i] for i in [1, 2, 4, 5]] + \
    [nn.Linear(4096, num_classes),
    nn.Sigmoid()]
)

so that it is one big starred expression instead of named expressions that follow it.
The layer freezing is done outside the CustomAlexnet definition, after you have initialized the network.
Hope it works.
Daniel