SD_EntityRelationsTemplate is a template that's no longer used in v5.4+, so this suggests you use an outdated preset, with a task that tries to generate the relations classes. The modelinfoprovider is a new template starting in 5.4 and if that's not generated that indeed confirms you're using an outdated preset. (i.e. a custom preset you created in v5.3 or earlier, and copied it to v5.4).
I vaguely recall you did have this problem before or am I mistaken? We rarely update the vanilla presets, however in v5.4 we had to make these changes (all in 1 go)