Currently using the pycocotools 2.0 library.
My train_loader is:
train_loader, test_loader = get_train_test_loader('dataset', batch_size=16, num_workers=4)
However the training lines of code:
for i, data in enumerate(train_loader, 0):
images, targets = data
images = images.to(device)
targets = targets.to(device)
Results in error. Variables data, images, and targets are all of class tuple
Traceback (most recent call last):
File "train.py", line 40, in <module>
images = images.to(device)
AttributeError: 'tuple' object has no attribute 'to'
How can I properly send these to cuda device?'
Edit:
I can send images[0].to(device) no problem. How can I send the rest?