You shouldn’t wrap your DataLoader instance into a sampler.RandomSampler.
Just use this loop:
for data in test_loader:
    img, label = data

# or

for img, label in test_loader:
    # your training code