Below is the training function I am writing, yet, there is this error: ‘NoneType’ object has no attribute ‘parameters’. I don’t really know how to solve it
def train(net, train_loader, test_loader, logger):    
    # TODO: Define the SGD optimizer here. Use hyper-parameters from cfg
    
    optimizer = optim.SGD(net.parameters(),lr=cfg['lr'],momentum=cfg['momentum'],weight_decay=cfg['weight_decay'], nesterov=cfg['nesterov'])
    # TODO: Define the criterion (Objective Function) that you will be using
    criterion = nn.CrossEntropyLoss()