I've not encountered this issue, but I think I would try a spray adhesive that they use for automobile headliners....
You use the push button and tube approach that is on a can of WD40 instead of the traditional spray button. You poke a hole in the carpet with an ice pick, then insert the tube in the hole and spray glue in a few different directions. Just short taps needed. May need to do this in several places if a lot of it is sagging. Once glue is in place press a board against the carpet, lightly wedge it in place with a brace and let it dry.
Larry