Thanks @ptrblck !
About that strange line maybe there is something that I’m not doing right.
This is the way I load the dataset:
train_set = DicomDataset(ROOT_PATH, 'train')
test_set = DicomDataset(ROOT_PATH, 'test')
train_set_loader = torch.utils.data.DataLoader(train_set, batch_size=5, shuffle=True)
test_set_loader = torch.utils.data.DataLoader(test_set, batch_size=5, shuffle=True)

And this is the way I iterate over it in my model:
# more code before
 n_total_steps = len(self.train_set_loader)
        for epoch in range(self.num_epochs):
            i = 0
            for item in enumerate(self.train_set_loader):
                images = item[1]["image"].to(device)
                labels = item[1]["label"].to(device)

# some more code after

If I don’t use float() I get this error : AttributeError: 'list' object has no attribute 'to' or AttributeError: 'str' object has no attribute 'to'
Is it a good practice use float() or should I use another approach to read/save/load/iterate “labels” ?