Solved by reallyclean-sauce in post #5 
              
              
                Ohh right, the self is also counted as an argument. Thanks for the reminder! 
Anyway, I just solved my problem. It appears that I am using the wrong CocoDetection Dataset class. I orginally used: 
import torchvision.datasets as dset
# and then
coco_test = dset.CocoDetection(root = root_dir,
        …