You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Traceback (most recent call last):
File "/home/nikola/code/pytorch-examples/examples/OpenNMT/translate.py", line 116, in
main()
File "/home/nikola/code/pytorch-examples/examples/OpenNMT/translate.py", line 77, in main
predBatch, predScore, goldScore = translator.translate(srcBatch, tgtBatch)
File "/home/nikola/code/pytorch-examples/examples/OpenNMT/onmt/Translator.py", line 195, in translate
pred, predScore, attn, goldScore = self.translateBatch(batch)
File "/home/nikola/code/pytorch-examples/examples/OpenNMT/onmt/Translator.py", line 60, in translateBatch
encStates, context_t = self.model.encoder(srcBatch_t, hidden=encStates)
File "/home/nikola/anaconda3/lib/python3.6/site-packages/torch/nn/modules/module.py", line 235, in getattr
return object.getattribute(self, name)
AttributeError: 'DataParallel' object has no attribute 'encoder'
If I change self.model.encoder to self.model.module.encoder on line 60, i get OOM. Loading this model from checkpoint, to resume training, works fine.
Thanks!
The text was updated successfully, but these errors were encountered:
GPU: 4 Titan X
Traceback (most recent call last):
File "/home/nikola/code/pytorch-examples/examples/OpenNMT/translate.py", line 116, in
main()
File "/home/nikola/code/pytorch-examples/examples/OpenNMT/translate.py", line 77, in main
predBatch, predScore, goldScore = translator.translate(srcBatch, tgtBatch)
File "/home/nikola/code/pytorch-examples/examples/OpenNMT/onmt/Translator.py", line 195, in translate
pred, predScore, attn, goldScore = self.translateBatch(batch)
File "/home/nikola/code/pytorch-examples/examples/OpenNMT/onmt/Translator.py", line 60, in translateBatch
encStates, context_t = self.model.encoder(srcBatch_t, hidden=encStates)
File "/home/nikola/anaconda3/lib/python3.6/site-packages/torch/nn/modules/module.py", line 235, in getattr
return object.getattribute(self, name)
AttributeError: 'DataParallel' object has no attribute 'encoder'
If I change self.model.encoder to self.model.module.encoder on line 60, i get OOM. Loading this model from checkpoint, to resume training, works fine.
Thanks!
The text was updated successfully, but these errors were encountered: