The ImageFolder will return a data and target sample, which will be stored in frame, while labels contain your “real” target tensor.
I guess you want to remove the target tensor returned by the ImageFolder dataset, so use:
frame = frame[0]

to only keep the returned data tensor and pass it to the model.
PS: it’s better to post code snippets by wrapping them into three backticks ```, which makes debugging easier.