ZeroDivisionError: division by zero
### System Info

```shell
transformers v4.9.2
python v3.8
```


### Who can help?

_No response_

### Information

- [ ] The official example scripts
- [X] My own modified scripts

### Tasks

- [ ] An officially supported task in the `examples` folder (such as GLUE/SQuAD, ...)
- [X] My own task or dataset (give details below)

### Reproduction

when i was training my bert model use  ` CustomIterableDataset(torch.utils.data.IterableDataset)`, rise the follow error:
```
Traceback (most recent call last):
  File "train.py", line 102, in <module>
    main(args)
  File "train.py", line 85, in main
    trainer.train() 
  File "/home/jack/anaconda3/envs/py38trans4.19.2/lib/python3.8/site-packages/transformers/trainer.py", line 1316, in train
    return inner_training_loop(
  File "/home/jack/anaconda3/envs/py38trans4.19.2/lib/python3.8/site-packages/transformers/trainer.py", line 1627, in _inner_training_loop
    self.state.epoch = epoch + (step + 1) / steps_in_epoch
ZeroDivisionError: division by zero
```
i find that this line have a litter bug in [`/transformers/trainer.py`, line: 1516](https://github.com/huggingface/transformers/blob/main/src/transformers/trainer.py#L1526):
```
            steps_in_epoch = (
                len(epoch_iterator)
                if len_dataloader is not None  
                else args.max_steps * args.gradient_accumulation_steps
            )
```
The logic of  ` if len_dataloader is not None`  should be to determine whether `train_dataset` is  `IterableDataset`，But  whether `train_dataset` is  `IterableDataset` or not, len dataloader is 1，so, it should be change as follows:
```
            steps_in_epoch = (
                len(epoch_iterator)
                if not isinstance(self.train_dataset, torch.utils.data.IterableDataset) 
                else args.max_steps * args.gradient_accumulation_steps
            )
``` 

### Expected behavior

```shell
i will fix this bug
```

This issue has been automatically marked as stale because it has not had recent activity. If you think this still needs to be addressed please comment on this thread.

Please note that issues that do not follow the [contributing guidelines](https://github.com/huggingface/transformers/blob/main/CONTRIBUTING.md) are likely to be ignored.<|||||>Did you fix this problem,I'm having the same bug