Repository: pykeen/pykeen
Issue: `LabelBasedInitializer` endlessly loops on large dataset when using transformer encoder
Root cause: Resource Mishandling

### Describe the bug

When using `LabelBasedInitializer` with the transformer encoder to initialize entities, the initialization never terminates when used with a large dataset (Wikidata5M). As indicated by `tqdm`, it seems to iterate through all the entities, but always restarts when it reaches the end of the entities. It does this continuously. This issue doesn't occur when using `LabelBasedInitializer` with the default `CharacterEmbeddingTextEncoder`, or on smaller datasets such as FB15k-237.

### How to reproduce

```python
from pykeen.datasets import get_dataset
from pykeen.nn.init import LabelBasedInitializer
from pykeen.models import ERMLPE

dataset = get_dataset(dataset="Wikidata5M")
model = ERMLPE(
    embedding_dim=768,  # for BERT base
    entity_initializer=LabelBasedInitializer.from_triples_factory(
        triples_factory=dataset.training,
        encoder="transformer",
        batch_size=128
    ),
)
```

### Environment


| Key             | Value                    |
|-----------------|--------------------------|
| OS              | posix                    |
| Platform        | Linux                    |
| Release         | 3.10.0-1062.el7.x86_64   |
| Time            | Wed Jul 27 20:39:01 2022 |
| Python          | 3.9.0                    |
| PyKEEN          | 1.8.3-dev                |
| PyKEEN Hash     | UNHASHED                 |
| PyKEEN Branch   |                          |
| PyTorch         | 1.11.0+cu113             |
| CUDA Available? | false                    |
| CUDA Version    | 11.3                     |
| cuDNN Version   | 8200                     |

### Additional information

I execute the script in a slurm environment using a geforce3090 GPU.

### Issue Template Checks

- [X] This is not a feature request (use a different issue template if it is)
- [X] This is not a question (use the [discussions](https://github.com/pykeen/pykeen/discussions/new) forum instead)
- [X] I've read the text explaining why including environment information is important and understand if I omit this information that my issue will be dismissed

@avitrost 

could you run your snippet with logging set to DEBUG level? i.e.
```python
import logging
from pykeen.datasets import get_dataset
from pykeen.nn.init import LabelBasedInitializer
from pykeen.models import ERMLPE

logging.basicConfig(level=logging.DEBUG)

dataset = get_dataset(dataset="Wikidata5M")
model = ERMLPE(
    embedding_dim=768,  # for BERT base
    entity_initializer=LabelBasedInitializer.from_triples_factory(
        triples_factory=dataset.training,
        encoder="transformer",
        batch_size=128
    ),
)
```



As another note: `Wikidata5M`'s entity labels are their Wikidata IDs. Thus, encoding those via BERT base will likely not result in meaningful representations.

You may instead want to take a look into `WikidataTextRepresentation`, which retrieves entity labels and descriptions for all used Wikidata IDs and encodes those texts instead of the IDs. A usage example can be found in its docstring.

@mberr Thank you, I now see that there was a memory issue with my setup:
```
DEBUG:torch_max_mem.api:Checking error for OOM: CUDA out of memory. Tried to allocate 13.14 GiB (GPU 0; 23.70 GiB total capacity; 13.55 GiB already allocated; 7.22 GiB free; 14.48 GiB reserved in total by PyTorch) If reserved memory is >> allocated memory try setting max_split_size_mb to avoid fragmentation.  See documentation for Memory Management and PYTORCH_CUDA_ALLOC_CONF
INFO:torch_max_mem.api:Execution failed with batch_size=128
```
The restarting is it trying again with a lower batch size.