OSError: [Errno 116] Stale file handle
## Environment info
<!-- You can run the command `transformers-cli env` and copy-and-paste its output below.
     Don't forget to fill out the missing fields in that output! -->

- `transformers` version:
- Platform: linux
- Python version: 3.7
- PyTorch version (GPU?): 1.6
- Tensorflow version (GPU?): - 
- Using GPU in script?: - 
- Using distributed or parallel set-up in script?: - only 1 GPU

### Who can help
 Trainer: @sgugger
 examples/seq2seq: @patil-suraj

## Information
Hi, I am training finetune_trainer.py on on wmt dataset. I am getting the following error sometimes, do you have an idea what might cause it? thanks for any suggestion 

```
  File "finetune_trainer.py", line 342, in <module>
    main()
  File "finetune_trainer.py", line 256, in main
    if (os.path.isdir(training_args.output_dir) and not training_args.optimize_from_scratch) else None,
  File "/home/jim/trainer.py", line 814, in train
    self._maybe_log_save_evaluate(tr_loss, model, trial, epoch)
  File "/home/jim/trainer.py", line 885, in _maybe_log_save_evaluate
    self._save_checkpoint(model, trial, metrics=metrics)
  File "/home/jim/trainer.py", line 916, in _save_checkpoint
    torch.save(self.optimizer.state_dict(), os.path.join(output_dir, "optimizer.pt"))
  File "/home/jim/libs/anaconda3/envs/success/lib/python3.7/site-packages/torch/serialization.py", line 374, in save
    _legacy_save(obj, opened_file, pickle_module, pickle_protocol)
  File "/home/jim/libs/anaconda3/envs/success/lib/python3.7/site-packages/torch/serialization.py", line 214, in __exit__
    self.file_like.close()
OSError: [Errno 116] Stale file handle
```
Model I am using T5.

## To reproduce
this is not happening all the time, but it does happen

## Expected behavior

to run the codes

This probably seems more related to your system rather than `Trainer` or `finetune_trainer.py` <|||||>thanks, but I just do not see why this happens, any idea is appreciated

On Thu, Jan 21, 2021 at 5:01 PM Suraj Patil <notifications@github.com>
wrote:

> This probably seems more related to your system rather than Trainer or
> finetune_trainer.py
>
> —
> You are receiving this because you authored the thread.
> Reply to this email directly, view it on GitHub
> <https://github.com/huggingface/transformers/issues/9732#issuecomment-764746041>,
> or unsubscribe
> <https://github.com/notifications/unsubscribe-auth/ANVIVSDVFWQUXCYIYLAOA23S3BFVFANCNFSM4WNBWFSQ>
> .
>
<|||||>This issue has been automatically marked as stale and been closed because it has not had recent activity. Thank you for your contributions.

If you think this still needs to be addressed please comment on this thread.