Deformable RoIPooling causing error during multi-gpu training


I am using Deformable RoiPooling and FPN with multiple scales which uses trainable offsets. I am also training using DistributedDataParallel which requires all parameters to used to compute the loss.

Deformable RoIPooling doesn’t have to necessarily use all the scales for an batch. May be some scale may not be used in a given batch because of the level calculated using the RoiPool formula. At these cases some Deformable RoiPooling remains not used at that batch which leads to the error:

RuntimeError: Expected to have finished reduction in the prior iteration before starting a new one. This error indicates that your module has parameters that were not used in producing loss. You can enable unused parameter detection by (1) passing the keyword argument find_unused_parameters=Truetotorch.nn.parallel.DistributedDataParallel; (2) making sure all forwardfunction outputs participate in calculating loss. If you already have done the above two steps, then the distributed data parallel module wasn't able to locate the output tensors in the return value of your module'sforwardfunction. Please include the loss function and the structure of the return value offorward of your module when reporting this issue (e.g. list, dict, iterable).

How do I overcome this issue ? Any suggestions ?