As the error message and the print suggests, labels is a dict, while a tensor is expected.
I’m not familiar with your use case, but you would have to extract the valid target value out of the current dict, which contains the filename, folder, and more information.