What is the difference between torchvision.models.resnet50 and torchvision.models.__dict__['resnet50']?

Hi I intend to use MoCo and I have to modify to make it output results of each layer. Should I modify the forward function of Resnet50? Because the base encoder in MoCo is resnet50. However, when I modify the resnet.py and use it as the base encoder, I got error like “type error, forward function has unexpected argument 'num__classes”.
In the original code of MoCo, they use base_encoder= torchvision.models.dict[‘resnet50’]to get the base encoder. However, when I modify resnet.py I got the error mentioned above. Also when I didn’t modify the original code and use base_encoder = torchvision.models.resnet50, I got the similar error. Can somebody tell me how to figure out this problem?