Repository: pykeen/pykeen
Issue: result.save_to_directory
Root cause: Validation Gap

### Describe the bug

When I use the pipeline to train the model, an error will be reported when saving the json file

----> 7 result.save_to_directory(f'{dataset}_{model}')

File d:\workspace\pharmkg\pharmkg-master\model\pykeen\pykeen\src\pykeen\pipeline.py:313, in PipelineResult.save_to_directory(self, directory, save_metadata, save_replicates)
    311     json.dump(self.metadata, file, indent=2, sort_keys=True)
    312 with open(os.path.join(directory, 'results.json'), 'w') as file:
--> 313     json.dump(self._get_results(), file, indent=2, sort_keys=True)
    314 if save_replicates:
    315     self.save_model(os.path.join(directory, 'trained_model.pkl'))

File D:\Anaconda\lib\json\__init__.py:179, in dump(obj, fp, skipkeys, ensure_ascii, check_circular, allow_nan, cls, indent, separators, default, sort_keys, **kw)
    173     iterable = cls(skipkeys=skipkeys, ensure_ascii=ensure_ascii,
    174         check_circular=check_circular, allow_nan=allow_nan, indent=indent,
    175         separators=separators,
    176         default=default, sort_keys=sort_keys, **kw).iterencode(obj)
    177 # could accelerate with writelines in some versions of Python, at
    178 # a debuggability cost
--> 179 for chunk in iterable:
    180     fp.write(chunk)

File D:\Anaconda\lib\json\encoder.py:431, in _make_iterencode.<locals>._iterencode(o, _current_indent_level)
    429     yield from _iterencode_list(o, _current_indent_level)
    430 elif isinstance(o, dict):
--> 431     yield from _iterencode_dict(o, _current_indent_level)
    432 else:
    433     if markers is not None:

File D:\Anaconda\lib\json\encoder.py:405, in _make_iterencode.<locals>._iterencode_dict(dct, _current_indent_level)
    403         else:
    404             chunks = _iterencode(value, _current_indent_level)
--> 405         yield from chunks
    406 if newline_indent is not None:
    407     _current_indent_level -= 1

File D:\Anaconda\lib\json\encoder.py:405, in _make_iterencode.<locals>._iterencode_dict(dct, _current_indent_level)
    403         else:
    404             chunks = _iterencode(value, _current_indent_level)
--> 405         yield from chunks
    406 if newline_indent is not None:
    407     _current_indent_level -= 1

File D:\Anaconda\lib\json\encoder.py:405, in _make_iterencode.<locals>._iterencode_dict(dct, _current_indent_level)
    403         else:
    404             chunks = _iterencode(value, _current_indent_level)
--> 405         yield from chunks
    406 if newline_indent is not None:
    407     _current_indent_level -= 1

File D:\Anaconda\lib\json\encoder.py:325, in _make_iterencode.<locals>._iterencode_list(lst, _current_indent_level)
    323         else:
    324             chunks = _iterencode(value, _current_indent_level)
--> 325         yield from chunks
    326 if newline_indent is not None:
    327     _current_indent_level -= 1

File D:\Anaconda\lib\json\encoder.py:438, in _make_iterencode.<locals>._iterencode(o, _current_indent_level)
    436         raise ValueError("Circular reference detected")
    437     markers[markerid] = o
--> 438 o = _default(o)
    439 yield from _iterencode(o, _current_indent_level)
    440 if markers is not None:

File D:\Anaconda\lib\json\encoder.py:179, in JSONEncoder.default(self, o)
    160 def default(self, o):
    161     """Implement this method in a subclass such that it returns
    162     a serializable object for ``o``, or calls the base implementation
    163     (to raise a ``TypeError``).
   (...)
    177 
    178     """
--> 179     raise TypeError(f'Object of type {o.__class__.__name__} '
    180                     f'is not JSON serializable')

TypeError: Object of type int32 is not JSON serializable

### How to reproduce

model = 'TransR'
result = pipeline(
    model=model,
    training_triples_factory=train,
    validation_triples_factory=valid,
    testing_triples_factory=test,
    training_kwargs={'num_epochs':300}, # 30
    model_kwargs={'embedding_dim':300},
    stopper='early',
    stopper_kwargs={'frequency':10, 'stopped':True, 'patience':1},
    evaluation_kwargs={'batch_size':32},
    optimizer_kwargs={'lr':0.1},
)
print(result)
result.save_to_directory(f'{dataset}_{model}')

### Environment

python = 3.9.12 
pykeen = 1.0.1-dev

### Additional information

_No response_

### 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

It appears you’re using a very very old version of pykeen. Please try upgrading to the latest version