I  am working on Melanoma Classification task where I have to classify the patients into two categories on the basis of their skin images. I have used efficientnetb3 model (pretrained) with minor transformations. But I am getting nan as the model output while training. What could be the possible reasons?
class MelanomaDataset(Dataset):

    def __init__(self, dataframe, image_dir, transforms = None):
        self.dataframe = dataframe
        self.image_dir = image_dir
        self.transforms = transforms

    def __len__(self):
        return self.dataframe.shape[0]

    def __getitem__(self, idx):
        img_name = '{}.png'.format(self.dataframe.iloc[idx, 0])
        fullname = self.image_dir + img_name
        image = cv2.imread(fullname)
        image = cv2.cvtColor(image, cv2.COLOR_BGR2RGB)

        num = self.dataframe.loc[:,'target'].iloc[idx]
        label = np.asarray(int_to_label[num])

        if self.transforms:
            image = self.transforms(image = image)['image']

        return image, label