Tnx for your response, I have multiple sources for training. My data folders are like below:
Train/
         class1/
                   pos/
                   neg/

          class2/
                   pos/
                   neg/

When I’m using this with datasets.ImageFolder() it gives wrong labels to images, for example all negative should be 0 and all positives should be 1. how can I do this?