Add multithread dataloder support.
This commit is contained in:
parent
17de117bda
commit
a524d01ac3
|
@ -447,6 +447,14 @@ class BatchGroupMeaningDataloader(Dataset):
|
||||||
s += "--------------------------------------------------------\n"
|
s += "--------------------------------------------------------\n"
|
||||||
return s
|
return s
|
||||||
|
|
||||||
|
def detection_collate(batch):
|
||||||
|
return batch[0]
|
||||||
|
|
||||||
|
def dataloader(self, num_workers=1):
|
||||||
|
return DataLoader(
|
||||||
|
self, batch_size=1, num_workers=num_workers, collate_fn=BatchGroupMeaningDataloader.detection_collate
|
||||||
|
)
|
||||||
|
|
||||||
|
|
||||||
if __name__ == "__main__":
|
if __name__ == "__main__":
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue