Error while saving Pretrained model for Encoder and decoder
Author: anandhperumal
Pull request: no

## 🐛 Bug

<!-- Important information -->

Model I am using (Bert, XLNet....):

Language I am using the model on (English, Chinese....):

The problem arise when using:
* [ ] the official example scripts: (give details)
* [X] my own modified scripts: (give details)

The tasks I am working on is:
* [ ] an official GLUE/SQUaD task: (give the name)
* [X] my own task or dataset: (give details)

## To Reproduce

Steps to reproduce the behavior:

1. Define a model and try to save the model then the error occurs. This is because the encoder and decoder model is save in different directories and the directories are not created.  
In order to handle this, you need to check if the given path exists then the encoder folder exists if not create a folder above this [line](https://github.com/huggingface/transformers/blob/3f5ccb183e3cfa755dea2dd2afd9abbf1a0f93b8/transformers/modeling_encoder_decoder.py#L169)

Code to reproduce:
```
 from transformers import PreTrainedEncoderDecoder
model = PreTrainedEncoderDecoder.from_pretrained('bert-base-uncased', 'bert-base-uncased', cache_dir='../transformers/cache')
model.save_pretrained(final_model_output)
```
Error:

```
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/home/guest_1/anaconda3/envs/my_env/lib/python3.6/site-packages/transformers/modeling_encoder_decoder.py", line 167, in save_pretrained
    self.encoder.save_pretrained(os.path.join(save_directory, "encoder"))
  File "/home/guest_1/anaconda3/envs/my_env/lib/python3.6/site-packages/transformers/modeling_utils.py", line 239, in save_pretrained
    assert os.path.isdir(save_directory), "Saving path should be a directory where the model and configuration can be saved"
AssertionError: Saving path should be a directory where the model and configuration can be saved
```

<!-- If you have a code sample, error messages, stack traces, please provide it here as well. -->

## Expected behavior

<!-- A clear and concise description of what you expected to happen. -->

## Environment


    OS: ubuntu
    Python version: 3.6
    PyTorch version:1.3.0
    PyTorch Transformers version (or branch):2.2.0
    Using GPU ? Yes
    Distributed of parallel setup ? No
    Any other relevant information:


## Additional context

<!-- Add any other context about the problem here. -->


Comments:
I resolved this issue you've raised correctly. I'll make a PR today to solve this bug! :)
UPDATE: I've made the PR: you can look [here](https://github.com/huggingface/transformers/pull/2201).

> ##  Bug
> Model I am using (Bert, XLNet....):
> 
> Language I am using the model on (English, Chinese....):
> 
> The problem arise when using:
> 
> * [ ]  the official example scripts: (give details)
> * [x]  my own modified scripts: (give details)
> 
> The tasks I am working on is:
> 
> * [ ]  an official GLUE/SQUaD task: (give the name)
> * [x]  my own task or dataset: (give details)
> 
> ## To Reproduce
> Steps to reproduce the behavior:
> 
> 1. Define a model and try to save the model then the error occurs. This is because the encoder and decoder model is save in different directories and the directories are not created.
>    In order to handle this, you need to check if the given path exists then the encoder folder exists if not create a folder above this [line](https://github.com/huggingface/transformers/blob/3f5ccb183e3cfa755dea2dd2afd9abbf1a0f93b8/transformers/modeling_encoder_decoder.py#L169)
> 
> Code to reproduce:
> 
> ```
>  from transformers import PreTrainedEncoderDecoder
> model = PreTrainedEncoderDecoder.from_pretrained('bert-base-uncased', 'bert-base-uncased', cache_dir='../transformers/cache')
> model.save_pretrained(final_model_output)
> ```
> 
> Error:
> 
> ```
> Traceback (most recent call last):
>   File "<stdin>", line 1, in <module>
>   File "/home/guest_1/anaconda3/envs/my_env/lib/python3.6/site-packages/transformers/modeling_encoder_decoder.py", line 167, in save_pretrained
>     self.encoder.save_pretrained(os.path.join(save_directory, "encoder"))
>   File "/home/guest_1/anaconda3/envs/my_env/lib/python3.6/site-packages/transformers/modeling_utils.py", line 239, in save_pretrained
>     assert os.path.isdir(save_directory), "Saving path should be a directory where the model and configuration can be saved"
> AssertionError: Saving path should be a directory where the model and configuration can be saved
> ```
> 
> ## Expected behavior
> ## Environment
> ```
> OS: ubuntu
> Python version: 3.6
> PyTorch version:1.3.0
> PyTorch Transformers version (or branch):2.2.0
> Using GPU ? Yes
> Distributed of parallel setup ? No
> Any other relevant information:
> ```
> 
> ## Additional context

@TheEdoardo93 did you try doing inference ?