Fix quantization test failure
Summary: # Context In post training quantization callback, we make a deepcopy of the Lightning module before validation start and prepare the copy with FX quantization API. The callback keeps the prepared model inside it. # The problem By the second time we run the validation epoch, we try to make a copy of the Lightning module, which has a reference to trainer, which has a reference to quantization callback, which has a prepared model, which is not deepcopiable. # Mitigation Delete the trainer before making a deepcopy. We're already doing that in stl/callbacks/quantization, but the changes were not ported into D2 (https://github.com/facebookresearch/d2go/commit/4169abc18ec539a24081b179fcbbc5a5754d102b)Go. Reviewed By: zhanghang1989 Differential Revision: D29409085 fbshipit-source-id: 24550124181673b2e567b2a04563bcdfb440e145
Showing
Please register or sign in to comment