Doesn’t the getitem have to have the
if torch.is_tensor(idx):
            idx = idx.tolist()

lines in it?
Disregard. I think I got it to work:
class image_Dataset(Dataset):
    '''
    image class data set   
    
    '''
    def __init__(self, data, transform = None):
        '''
        Args:
        ------------------------------------------------------------
            data = dataframe
            image = column in dataframe with absolute path to the image
            label = column in dataframe that is the target classification variable
            numerical_columns =  numerical columns from data
            categorical_columns = categorical columns from data
            policy = ID variable
            
        '''
        self.image_frame = data
        self.transform = transform
        
    def __len__(self):
        return len(self.image_frame)
    
    def __getitem__(self, idx):
    
        label = list(self.image_frame.loc[:, 'target'])

        #pic = Path(self.image_frame.loc[idx, 'location'])
        image = self.transform(Image.open(pathlib.Path(self.image_frame.loc[:, 'location'].values[0])))
        
        policy = list(self.image_frame.loc[:, 'policy'])
        
        numerical_data = np.asarray((self.image_frame.loc[:, numerical_columns]))

        
        #numerical_data = torch.tensor(numerical_data, dtype = torch.float)

        
        for category in non_loca_cat_columns:
            self.image_frame[category] = self.image_frame[category].astype('category')
            
            self.image_frame[category] = self.image_frame[category].astype('category').cat.codes.values
        
            
        categorical_data = np.asarray(self.image_frame.loc[:, non_loca_cat_columns])
        
        label = torch.FloatTensor(label)
        image = torch.FloatTensor(image)
        policy = torch.FloatTensor(policy)
        numerical_data = torch.FloatTensor(numerical_data)


        return image, label, policy, categorical_data , numerical_data