'SequenceClassifierOutput' object has no attribute 'log_softmax'
Hi there, 

I'm trying to transfer the pre-trained ViT model (model base patch 16, image size 224) on Cassava Leaf Disease Dataset. However, when I started to train the model, I encountered an error: 'SequenceClassifierOutput' object has no attribute 'log_softmax' which is shown in details in the attached image.
Can someone help me with this error?

Many thanks.
![1](https://user-images.githubusercontent.com/41022754/119471445-7ebaeb80-bd73-11eb-9aeb-21f6c984a8b2.PNG)



Hello! Could you share the code you have that led to this error? Thanks<|||||>This is my source code.  I use google colab. Thank  you for your fast reply.
[https://drive.google.com/file/d/1zRKRolc-IuKAt_J96gTCoO801r6eXu2q/view?usp=sharing](url)
<|||||>I think the issue is that you have:
```py

class CassvaImgClassifier(nn.Module):
    def __init__(self, model_arch, n_class, pretrained=False):
        super().__init__()
        self.model = ViTForImageClassification.from_pretrained('google/vit-base-patch16-224')
        ... 

    def forward(self, x):
        x = self.model(x)
        return x

```
as a model; if I follow closely enough you're getting the outputs with:

```py
image_preds = model(imgs)
```

These will really be the outputs of the ViT model, which is a [`SequenceClassifierOutput`](https://huggingface.co/transformers/main_classes/output.html#transformers.modeling_outputs.SequenceClassifierOutput) as you can see from the [ViT docs](https://huggingface.co/transformers/model_doc/vit.html#transformers.ViTForImageClassification.forward)

I suppose you're interested in the `logits`, so you would have to do:
```py
image_preds = model(imgs).logits
```
instead.

Hope that helps.<|||||>Thank you very much. It works for me. 
