0

because my train model is on multiple GPU, during training , I use trainer.extend to validate my model every epoch, But chainer.training.extensions.Evaluator has only one device argument, but my model network parameter is on 2 GPUs. how to validate in this situation?

machen
  • 283
  • 2
  • 10

1 Answers1

0

The device argument of Evaluator indicates to which device the input data should be put. It does nothing about model parameters.

If your model needs the input data loaded to multiple GPUs as well, Evaluator does not support such case directly so you have to customize it. The easiest way is setting a custom converter function (which is responsible on copying the data to appropriate devices). See the document of Evaluator for the details of converter. https://docs.chainer.org/en/stable/reference/generated/chainer.training.extensions.Evaluator.html

Seiya Tokui
  • 341
  • 2
  • 3