Hi,
It happens to me, z370m d3h, I have last bios, F5, and High Sierra. It happens when I make some changes in the BIOS. When it happens I reset the bios from the mb jumper, and after that I change the minimal options in BIOS and save. Usually is solved, if not I repeat. The problem is gone...