Solved by ptrblck in post #2 
              
              
                The error is most likely raised as you are trying to use the pretrained model, while also specifying another number of classes. 
You could remove the **classes argument to load the “standard” pretrained model with 1000 output classes and replace the last fully connected layer: 
resnet152_model = res…