Fix Trainer for Datasets that don't have dict items
# What does this PR do?

This PR fixes a break in `Trainer` when the dataset items are not dictionaries.
_The documentation is not available anymore as the PR was closed or merged._<|||||>You're welcome 