You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The error 'list' object has no attribute 'to' indicates that you are trying to call the .to(device) method on a list object, which is not possible because Python lists do not have this method. This error typically arises when using PyTorch and expecting a tensor instead of a list. Here’s how to resolve this issue:
Check DataLoader Output: Ensure that your DataLoader is returning a PyTorch tensor rather than a list. You might need to adjust how your dataset is processed or how your DataLoader is configured.
Convert List to Tensor: If the DataLoader is supposed to return a list and you need it to be a tensor, you can manually convert the list to a tensor using torch.Tensor(). For example:
I am not able to train a model.
When I use my own data loader, it gives:
![image](https://private-user-images.githubusercontent.com/23525754/319022422-7d9995ac-6ba3-40db-970d-146777770764.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MzkwMDM3MDEsIm5iZiI6MTczOTAwMzQwMSwicGF0aCI6Ii8yMzUyNTc1NC8zMTkwMjI0MjItN2Q5OTk1YWMtNmJhMy00MGRiLTk3MGQtMTQ2Nzc3NzcwNzY0LnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNTAyMDglMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjUwMjA4VDA4MzAwMVomWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPTlkMjllNjYxMzk0MzIyODJlNmRmNjZjNDVhY2I1ZmM5NzY4MmUxMjg1ZDFiNDk4MmIxYTU3Nzk0MGIyMjBiYWQmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0In0.duJY0dUqfLkwm7Se10B2YWJQOnEH8BpGzNVUJy1ggao)
The text was updated successfully, but these errors were encountered: