I wanna use ddp to train my model, while I encounter this issue:

RuntimeError: initialize_buckets must NOT be called during autograd execution.

Could anyone give me help ?
This error will appear at the end of the second epoch, and the first epoch is good.

Snipaste_2021-05-04_16-24-001129×766 42.7 KB