Solved by ptrblck in post #2 
              
              
                It looks like the actual factory to create the model is defiend here, i.e. as pretrainedmodels.models.xception(), while you created an instance of xception.Xception manually. 
Since self.last_linear is only redefined in the factory (line of code), you could try to set the last_linear again to your c…