optimizer got an empty parameter list
If I use optim.SGD(model_conv.fc.parameters() I'm getting an error:
optimizer got an empty parameter list

This error is, when model_conv.fc is nn.Hardtanh(...) (also when I try to use ReLu).
But with nn.Linear it works fine.
What could be the reason?
model_conv.fc = nn.Hardtanh(min_val=0.0, max_val=1.0) #not ok --&gt; optimizer got an empy parameter list
#model_conv.fc = nn.ReLU() #also Not OK
# num_ftrs = model_conv.fc.in_features
# model_conv.fc = nn.Linear(num_ftrs, 1) #it works fine


model_conv = model_conv.to(config.device())

optimizer_conv = optim.SGD(model_conv.fc.parameters(), lr=config.learning_rate, momentum=config.momentum) #error is here


Hardtanh and ReLU are parameter-free layers but Linear has parameters.
