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

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

python -model data/norm/ -src data/norm/ -tgt data/norm/tst.en -output data/norm/ep2.en -gpu 2
Traceback (most recent call last):
File “”, line 116, in
File “”, line 77, in main
predBatch, predScore, goldScore = translator.translate(srcBatch, tgtBatch)
File “/home/”, line 195, in translate
pred, predScore, attn, goldScore = self.translateBatch(batch)
File “/home/”, line 60, in translateBatch
encStates, context_t = self.model.encoder(srcBatch_t, hidden=encStates)
File “/home/”, 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 ?