my code of the model is
class Inception(nn.Module):
  def __init__(self,model,feature_dim=2048,name='inception'):
    super(Inception, self).__init__()
    self.model_name=name
    model.maxpool = nn.AdaptiveMaxPool2d((1))
    del model.fc
    model.fc = lambda x:x
    self.features = model
    self.classifier = nn.Linear(feature_dim,20)

  def forward(self,x):
    features = self.features(x)
    # if not isinstance(features, Variable):
    #   pdb.set_trace()
    #   features = Variable(features).cuda()
    return self.classifier(features)

def inception_v3(pretrained=True):
  model = tv.models.inception_v3(pretrained=pretrained)
  return Inception(model)

while training, got the following error:
Traceback (most recent call last):
  File "train.py", line 146, in <module>                                        [00:36<00:01,  1.16s/it]
    main()
  File "train.py", line 141, in main
    trainer.train()
  File "/media/sjtu/831bebd9-c866-4ece-b878-5dbd68e5ca50/sjtu/CH/image_scene_classification/SC/model/trainer.py", line 291, in train
    self.train_epoch()
  File "/media/sjtu/831bebd9-c866-4ece-b878-5dbd68e5ca50/sjtu/CH/image_scene_classification/SC/model/trainer.py", line 228, in train_epoch
    output = self.model(inputs)
  File "/home/sjtu/anaconda2/envs/scene/lib/python3.6/site-packages/torch/nn/modules/module.py", line 357, in __call__
    result = self.forward(*input, **kwargs)
  File "/media/sjtu/831bebd9-c866-4ece-b878-5dbd68e5ca50/sjtu/CH/image_scene_classification/SC/model/inception.py", line 30, in forward
    return self.classifier(features)
  File "/home/sjtu/anaconda2/envs/scene/lib/python3.6/site-packages/torch/nn/modules/module.py", line 357, in __call__
    result = self.forward(*input, **kwargs)
  File "/home/sjtu/anaconda2/envs/scene/lib/python3.6/site-packages/torch/nn/modules/linear.py", line 55, in forward
    return F.linear(input, self.weight, self.bias)
  File "/home/sjtu/anaconda2/envs/scene/lib/python3.6/site-packages/torch/nn/functional.py", line 833, in linear
    if input.dim() == 2 and bias is not None:
AttributeError: 'tuple' object has no attribute 'dim'

while set the break point, got the features is torch.Size([50, 2048]) and torch.Size([50, 1000])
anyone get the solution?