How to disable the automatic reduce/mean while using dp? #7009
-
Hello everyone, I have upgraded pytorch-lightning to 1.2.6 recently, the behavior of dp seems different from 1.2.0. To be specific, the returned values of validation_step() are automatically reduced before sent to validation_epoch_end(). However, the metrics I use need the original predictions of each sample instead of the reduced values. Is there a way to disable the automatic reduce and pass the whole predictions to validation_epoch_end()? Note that the validation_step_end() is not implemented in my model. cc: @tchaton |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
I notice that the validation_step_end() and test_step_end() functions in dp.py script are:
Thus, overwrite these two methods as follows will disable the automatic reduce in evaluation and test:
|
Beta Was this translation helpful? Give feedback.
I notice that the validation_step_end() and test_step_end() functions in dp.py script are:
Thus, overwrite these two methods as follows will disable the automatic reduce in evaluation and test: