andreasveit / triplet-network-pytorch

370 stars 95 forks source link

list index out of range #12

Closed samo313 closed 4 years ago

samo313 commented 4 years ago

Hi, there is some new error here how can I handle this error? line 47, in init triplets.append((int(line.split()[0]), int(line.split()[1]), int(line.split()[2]))) # anchor, close, far

IndexError: list index out of range

samo313 commented 4 years ago

Hi, there is some new error here how can I handle this error? line 47, in init triplets.append((int(line.split()[0]), int(line.split()[1]), int(line.split()[2]))) # anchor, close, far

IndexError: list index out of range use an if and else like below in test and train part :)

for line in open(os.path.join(root, self.processed_folder, self.train_triplet_file)): if not (line.split()==[]): triplets.append((int(line.split()[0]), int(line.split()[1]), int(line.split()[2]))) # anchor, close, far else: continue