Last active
November 5, 2019 12:50
-
-
Save tkshnkmr/0cb67b01b308f1634633bd6a46daa990 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# path to your own data and coco file | |
train_data_dir = 'my_data/train' | |
train_coco = 'my_data/my_train_coco.json' | |
# create own Dataset | |
my_dataset = myOwnDataset(root=train_data_dir, | |
annotation=train_coco, | |
transforms=get_transform() | |
) | |
# collate_fn needs for batch | |
def collate_fn(batch): | |
return tuple(zip(*batch)) | |
# Batch size | |
train_batch_size = 1 | |
# own DataLoader | |
data_loader = torch.utils.data.DataLoader(my_dataset, | |
batch_size=train_batch_size, | |
shuffle=True, | |
num_workers=4, | |
collate_fn=collate_fn) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment