I’m on my course project and wanted to classify bird images.
I kinda sticked to the provided code and adjusted the class PetsDataset(Dataset) to fit for my dataset.
That took me some time but it worked.
In cell 13 I can plot the loaded Dataset.
But when I transfer the dataset to the GPU and run the model, I get an error I don’t know how to deal with (cell 37)
AttributeError Traceback (most recent call last)
----> 1 history = [evaluate(model, valid_dl)]
in to_device(data, device)
11 if isinstance(data, (list, tuple)):
12 return [to_device(x, device) for x in data]
—> 13 return data.to(device, non_blocking=True)
AttributeError: ‘str’ object has no attribute ‘to’
Can someone tell me whats my mistake?
Maybe because my self.classes is a dictionary and not a list?