Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- def combineDataloaders2(loader1,loader2):
- combineddata = []
- combinedtarget = []
- for batch in loader1:
- for img in batch[0]:
- combineddata.append(img)
- for label in batch[1]:
- combinedtarget.append(label)
- for batch in loader2:
- for img in batch[0]:
- combineddata.append(img)
- for label in batch[1]:
- combinedtarget.append(label)
- print(combineddata[0].shape)
- combinedDataset = MyCombinedDataset(combineddata, combinedtarget)
- dataloader = DataLoader(combinedDataset, batch_size=batch_size)
- return dataloader
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement