HELP! 'DataParallel' object has no attribute 'encoder'

Every time after training the model when I try to translate I get following error:

python translate.py -model data/norm/model_e3_3656.27.pt -src data/norm/tst.pl -tgt data/norm/tst.en -output data/norm/ep2.en -gpu 2
Traceback (most recent call last):
File “translate.py”, line 116, in
main()
File “translate.py”, line 77, in main
predBatch, predScore, goldScore = translator.translate(srcBatch, tgtBatch)
File “/home/pjwstk.edu.pl/kwolk/OpenNMT-py/onmt/Translator.py”, line 195, in translate
pred, predScore, attn, goldScore = self.translateBatch(batch)
File “/home/pjwstk.edu.pl/kwolk/OpenNMT-py/onmt/Translator.py”, line 60, in translateBatch
encStates, context_t = self.model.encoder(srcBatch_t, hidden=encStates)
File “/home/pjwstk.edu.pl/kwolk/venv/lib/python2.7/site-packages/torch/nn/modules/module.py”, line 235, in getattr
return object.getattribute(self, name)
AttributeError: ‘DataParallel’ object has no attribute ‘encoder’

Please help

The PyTorch version will soon be updated from the folks at pytorch/examples:

Does this particular error happen after training with multiple GPUs?

Thank you for your tip. When I trained using single GPU there was no problem with translation. In that case do you possible plan to repair the problem in near future ?