This issue is driving me crazy.
I have a late 2014 retina iMac and a mid 2017 retina iMac. I updated both to 10.13.4 at the same time and now both of them reboot or turn off while in sleep exactly 3 hours after in sleep mode. If they reboot, they freeze on the login screen and the screen stays on forever
Here is what I tried so far:
Disconnect all external devices
Reset the System Management Controller (SMC)
Reset the nonvolatile random-access memory (NVRAM)
Then use safeboot (SHIFT at Startup)
Then reboot normally with devices disconnected.
Erased Macintosh HD completely and reinstalled fresh macOS (without restoring Time Machine backup or any other stuff, so basically untouched system).
Nothing helped so far. Seriously, Apple.... I'm confident this is a software related issue, since both my machines produce exactly the same symptom.