728x90
반응형

 
 
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 passing the keyword argument `find_unused_parameters=True` to `torch.nn.parallel.DistributedDataParallel`, and by making sure all `forward` function outputs participate in calculating loss. 
 
If you already have done the above, then the distributed data parallel module wasn't able to locate the output tensors in the return value of your module's `forward` function. Please include the loss function and the structure of the return value of `forward` of your module when reporting this issue (e.g. list, dict, iterable).
 
Parameter indices which did not receive grad for rank 1: 263 264 265 266 267 268 269 270 271 272 290 291 292 293 294 In addition, you can set the environment variable TORCH_DISTRIBUTED_DEBUG to either INFO or DETAIL to print out information about which particular parameters did not receive gradient on this rank as part of this error
 
 
 
가끔 학습하다보면 위와 같은 에러를 볼 때가 있는데, 손실함수에서 사용하지 않는 변수가 있을 때 나는 메세지이다. 
 
학습 중 사용되지 않는 파라미터가 있을 때 이와 관련된 에러 메세지가 나지 않게 하려면, 
 
즉, 이 메세지를 무시하려면 DistributedDataParallel 호출시 find_unused_parameters=True 인자를 추가하면 된다. 

728x90
반응형