data/
                melanoma/
                    AM(1).jpg
                    AM(2).jpg
                    AM(3).jpg
                    ...
                benign/
                    BN(1).jpg
                    BN(2).jpg
                    BN(3).jpg
                    ....

all images are stored in the right folder…
And
print(dataset.class_to_idx)

{'benign': 0, 'melanoma': 1}

I need to think about what the problem is.