How to extract data from Dataloader?

The dataloader is bulit with the AG_NEWS, I tried to demonstrate the labels and tensors in it in many ways but ended with the similar error which is shown in the Figure 2.

Can’t be more appreciated if you can give me a hand.

It looks like your data variable in your for loop is your incrementer and the label variable in there contains the inputs and labels. That’s what is being assigned in for (data, labels) in enumerate(full_train_loader) and I doubt that is what you want.

Still can’t fix it…

Do you get the same error if you change that line to for i, (data, labels) in enumerate(full_train_loader): ? That should be at least part of the problem. I can’t see the entire stack trace or code, so I don’t know if there are other issues as well.