Pretrained Wav2Vec2 Model large robust does not load
@patrickvonplaten

The behavior I notice is shown below. Any help is much appreciated!

Python 3.7.10
>>> from transformers import Wav2Vec2ForCTC
>>> mdl = Wav2Vec2ForCTC.from_pretrained('facebook/wav2vec2-large-robust')
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/home/hltcoe/mwiesner/.conda/envs/nnet_pytorch_env/lib/python3.7/site-packages/transformers/modeling_utils.py", line 1325, in from_pretrained
    model = cls(config, *model_args, **model_kwargs)
  File "/home/hltcoe/mwiesner/.conda/envs/nnet_pytorch_env/lib/python3.7/site-packages/transformers/models/wav2vec2/modeling_wav2vec2.py", line 1412, in __init__
    self.lm_head = nn.Linear(config.hidden_size, config.vocab_size)
  File "/home/hltcoe/mwiesner/.conda/envs/nnet_pytorch_env/lib/python3.7/site-packages/torch/nn/modules/linear.py", line 78, in __init__
    self.weight = Parameter(torch.Tensor(out_features, in_features))
TypeError: new() received an invalid combination of arguments - got (NoneType, int), but expected one of:
 * (*, torch.device device)
      didn't match because some of the arguments have invalid types: (NoneType, int)
 * (torch.Storage storage)
 * (Tensor other)
 * (tuple of ints size, *, torch.device device)
 * (object data, *, torch.device device)
Hey @m-wiesner, 

`'facebook/wav2vec2-large-robust'` is just a pretrained speech recognition model that does not have a lm head defined. So the model should be loaded as follows:

```python
from transformers import Wav2Vec2ForPreTraining
mdl = Wav2Vec2ForPreTraining.from_pretrained('facebook/wav2vec2-large-robust')
```

If you would like to use the model to fine-tune it on a downstream task you have to define the vocabulary size first, *e.g.*:

```python
from transformers import Wav2Vec2ForCTC
mdl = Wav2Vec2ForCTC.from_pretrained('facebook/wav2vec2-large-robust', vocab_size=32)
```

which will then initialize a random linear layer as the lm head that needs to be fine-tuned.

But in any way the error message should have been better here! Let me correct this :-)
<|||||>🎉<|||||>Awesome. Most of the other models have the LM head attached and I've just been discarding that. Would it make sense to update the documentation to reflect the discrepancy between this and how the other wav2vec2 models are loaded?

Thanks for the rapid response!<|||||>Pretrained wav2vec2 models ideally should never have a vocab_size defined in the config. We can't change this anymore though because of backward compatibility. 