How to return  bert self attention, so that i can do visualization??
## ❓ Questions & Help
model = BertForSequenceClassification.from_pretrained("bert-base-uncased", num_labels= 2, output_attentions=True)
model.cuda()
I am useing the above code to return the attention weights, for visualizing the attention by BertViz.
But it gave me this error ( __init__( ) got an unexpected keyword argument 'output_attentions').
Also, please if you recommend any tutorial for beginner, which explain how to return the attention
<!-- A clear and concise description of the question. -->

Hi! Could you specify which version of our library you are using? Thank you.<|||||>Hi
I am useing "pip install pytorch-pretrained-bert pytorch-nlp"<|||||>I believe the way to output attentions in `pytorch-pretrained-BERT` v0.6.2 was to specify the `output_all_encoded_layers` to `True` in the model forward call.

Please be aware that this version has been deprecated for some time now. The new version is called `transformers` and should be installed with `pip install transformers`.<|||||>
Thank for the quick reply
how about if i want to use transformers how to output the attention ??<|||||>If you want to use transformers to output the attention you can specify it in the config:

```py
config = BertConfig.from_pretrained("bert-base-cased", output_attentions=True, num_labels=2)
model = BertForSequenceClassification.from_pretrained("bert-base-cased", config=config)
```<|||||>> I believe the way to output attentions in pytorch-pretrained-BERT v0.6.2 was to specify the output_all_encoded_layers to True in the model forward call.
> Please be aware that this version has been deprecated for some time now. The new version is called transformers and should be installed with pip install transformers.

Do you mean some things like this
# Forward pass
loss = model(b_input_ids, token_type_ids=None, attention_mask=b_input_mask, labels=b_labels, output_all_encoded_layers = True)<|||||>Yes, that’s what I meant!<|||||>> Yes, that’s what I meant!

I am getting  this error 
TypeError: forward() got an unexpected keyword argument 'output_all_encoded_layers'<|||||>> Yes, that’s what I meant!
I am getting this error. any idea please
TypeError: forward() got an unexpected keyword argument 'output_all_encoded_layers'
![attentionError](https://user-images.githubusercontent.com/55197626/66332937-e1901280-e903-11e9-8af6-0587d7a00296.PNG)

<|||||>Which version of the lib are you using in that example?<|||||>> Which version of the lib are you using in that example?

old one 
pytorch-pretrained-bert pytorch-nlp<|||||>Is there any way you could update to `transformers`? That would make life easier.<|||||>This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.
