Training Loss not improving so much

Epoch: 0 – Training Loss: 0.057411
Epoch: 1 – Training Loss: 0.056986
Epoch: 2 – Training Loss: 0.057286
Epoch: 3 – Training Loss: 0.057266

Anyone knows why it is sooo slow ??
My data set have 1248 images for training

CODE:

model = models.densenet121(pretrained = True)

manter os features parameters

for param in model.parameters():
param.requires_grad = False
criterion = nn.NLLLoss()

optimizer = optim.Adam(model.parameters(), lr=0.003)

for e in range(epochs):
# keep track of training and validation loss
running_loss = 0.0
running_corrects = 0.0

for inputs, label in (dataloaders['train']):
    model.train()
    # IF GPU is availible
    if train_on_gpu:
        inputs, label = inputs.cuda(), label.cuda()
    
    optimizer.zero_grad()
    with torch.set_grad_enabled(True):
        logps = model(inputs)
        _, preds = torch.max(logps, 1) # tecnica nova de validacao
        loss = criterion(logps, label)
        loss.backward()
        optimizer.step()
    
        running_loss += loss.item()
        running_corrects += torch.sum(preds == label.data)

I haven’t check but does densenet softmax already incorporated inside the model?

no , but this is not the problem here

Could you tell me why you are using this line?

Seems to me that setting the requires grad to False, prevents the optimizer from calculating gradients for the parameters and prevents any optimization from taking place.