Hi again, I change in my train function this: loss_train += loss.item(), also I noticed that the classes of the dataset were unbalanced so I used this code to balance them. Even doing that my accuracy doesn´t change. What can I do?  Here is the code for the balance:
class_weights_train = 1./torch.Tensor(class_sample_counts_train)
class_weights_train = class_weights_train.double()

train_targets = [sample[1] for sample in bh_dataset_train]
train_samples_weight = [class_weights_train[class_id] for class_id in train_targets]

class_sample_counts_val = [48,1138,331,324,245,189,235,251]

class_weights_val = 1./torch.Tensor(class_sample_counts_val)
class_weights_val = class_weights_val.double()

val_targets = [sample[1] for sample in bh_dataset_val]
val_samples_weight = [class_weights_val[class_id] for class_id in val_targets]

train_sampler = torch.utils.data.sampler.WeightedRandomSampler(train_samples_weight, len(bh_dataset_train))
val_sampler = torch.utils.data.sampler.WeightedRandomSampler(val_samples_weight, len(bh_dataset_val))