I got the following error when the input data is too long.
Traceback (most recent call last):
File "/opt/conda/lib/python3.10/site-packages/onmt/trainer.py", line 503, in _gradient_accumulation
model_out, attns = self.model(
File "/opt/conda/lib/python3.10/site-packages/torch/nn/modules/module.py", line 1501, in _call_impl
return forward_call(*args, **kwargs)
File "/opt/conda/lib/python3.10/site-packages/onmt/models/model.py", line 189, in forward
enc_out, enc_final_hs, src_len = self.encoder(src, src_len)
File "/opt/conda/lib/python3.10/site-packages/torch/nn/modules/module.py", line 1501, in _call_impl
return forward_call(*args, **kwargs)
File "/opt/conda/lib/python3.10/site-packages/onmt/encoders/transformer.py", line 207, in forward
enc_out = self.embeddings(src)
File "/opt/conda/lib/python3.10/site-packages/torch/nn/modules/module.py", line 1501, in _call_impl
return forward_call(*args, **kwargs)
File "/opt/conda/lib/python3.10/site-packages/onmt/modules/embeddings.py", line 291, in forward
source = module(source, step=step)
File "/opt/conda/lib/python3.10/site-packages/torch/nn/modules/module.py", line 1501, in _call_impl
return forward_call(*args, **kwargs)
File "/opt/conda/lib/python3.10/site-packages/onmt/modules/embeddings.py", line 72, in forward
raise SequenceTooLongError(
onmt.modules.embeddings.SequenceTooLongError: Sequence is 6438 but PositionalEncoding is limited to 1. See max_len argument.
Traceback (most recent call last):
File "/opt/conda/bin/onmt_train", line 8, in <module>
sys.exit(main())
File "/opt/conda/lib/python3.10/site-packages/onmt/bin/train.py", line 67, in main
train(opt)
File "/opt/conda/lib/python3.10/site-packages/onmt/bin/train.py", line 49, in train
p.join()
File "/opt/conda/lib/python3.10/multiprocessing/process.py", line 149, in join
res = self._popen.wait(timeout)
File "/opt/conda/lib/python3.10/multiprocessing/popen_fork.py", line 43, in wait
return self.poll(os.WNOHANG if timeout == 0.0 else 0)
File "/opt/conda/lib/python3.10/multiprocessing/popen_fork.py", line 27, in poll
pid, sts = os.waitpid(self.pid, flag)
File "/opt/conda/lib/python3.10/site-packages/onmt/utils/distributed.py", line 159, in signal_handler
raise Exception(msg)
Exception:
When I had a look at this line, it seems that the logged limit of PositionalEncoding is not correctly shown. I think pe.size(1) should be logged (instead of self.pe.size(1)) since the array was transposed. Could you confirm that it needs to be updated?
Hello,
I got the following error when the input data is too long.
When I had a look at this line, it seems that the logged limit of
PositionalEncoding
is not correctly shown. I thinkpe.size(1)
should be logged (instead ofself.pe.size(1)
) since the array was transposed. Could you confirm that it needs to be updated?Thank you!