Just plan on the losses ahead of time. Try to ferment a bit more than you plan to bottle/keg. It allows you to lose some beer to the yeast cake and hop debris as well as take some samples, and still end up where you want.
I go with what I read from Jamil which is to finish with 6 gallons in the kettle, transfer 5.5 of that to the fermenter, allowing .5 gallons loss to the trub. This allows another .5 gallons loss to the yeast cake, readings, and dry-hops with a solid 5 gallons when you're finished. I've found it works well for me. I could probably get away with a little bit less, but keeping it at even amounts seems to make it easier to keep track of for me.