I have dataset class and dataloader as:
class SomeDataset(Dataset):
    def __init__(self, usage='val', dataset_pickle_file='./some.pkl', skip_every_n_image=1):
        super(SomeDataset, self).__init__()

        self.to_tensor = transforms.ToTensor()

        with open(dataset_pickle_file, 'rb') as file:
            self.data_info = pickle.load(file)[usage]
        self.idx = [i for i in range(0, len(self.data_info[0]), skip_every_n_image)]
        self.data_len = len(self.idx)

    def __len__(self):
        return self.data_len

    def __getitem__(self, index):  #1
        instanceNum = self.idx[index]
        color_img = self.data_info[0][instanceNum]
        color_imgPIL = Image.open(color_img)
        color_tensor = self.to_tensor(np.array(color_imgPIL))
        d_img = self.data_info[1][instanceNum] #2
        d_imgPIL = Image.open(d_img)
        d_tensor = self.to_tensor(np.array(d_imgPIL))
        output = {'image': color_tensor, 'dt': d_tensor}
        return output

train_dataloader = DataLoader(train_dataset, shuffle=True,
                                  batch_size=args.batch_size,
                                  num_workers=1)
d_net = ExtendedDnet().cuda()
optimizer = torch.optim.Adam(depth_net.parameters(), lr=args.learning_rate)
for epoch in range(2):
        d_net.train()
        for train_idx, train_data in enumerate(train_dataloader):
                 image = train_data['image'].cuda(non_blocking=True)

I am running the code in debug mode on PyCharm.
Just at the last line I am getting this error:

File “~/.pycharm_helpers/pydev/_pydevd_bundle/pydevd_resolver.py”, line 215, in resolve
return getattr(dict, key)
AttributeError: ‘dict’ object has no attribute ‘self’

Can you all please suggest what might be the issue? Thanks for the help!