dlwpt-code
dlwpt-code copied to clipboard
p
KeyError Traceback (most recent call last)
~\Documents\pythonProjects\pytorch-learning\p2ch13\prepcache.py in main(self) 49 50 self.prep_dl = DataLoader( ---> 51 PrepcacheLunaDataset( 52 # sortby_str='series_uid', 53 ),
~\Documents\pythonProjects\pytorch-learning\p2ch13\dsets.py in init(self, *args, **kwargs) 345 super().init(*args, **kwargs) 346 --> 347 self.candidateInfo_list = getCandidateInfoList() 348 self.pos_list = [nt for nt in self.candidateInfo_list if nt.isNodule_bool] 349
~\Documents\pythonProjects\pytorch-learning\p2ch13\dsets.py in getCandidateInfoList(requireOnDisk_bool) 47 annotationCenter_xyz = tuple([float(x) for x in row[1:4]]) 48 annotationDiameter_mm = float(row[4]) ---> 49 isMal_bool = {'False': False, 'True': True}[row[5]] 50 51 candidateInfo_list.append(
KeyError: '1.0'
I have fixed this error. the reason is that the row[5] in file annotations_with_malignancy.csv value is '1.0' or '0.0', but the code recive 'True' or 'False' I modify the code as isMal_bool = {'0.0': False, '1.0': True}[row[5]] #isMal_bool = {'False': False, 'True': True}[row[5]]