Dump_beam command line

Hello,

I’m trying to have a glimpse at the output of beam and I have been looking everywhere to understand how to get this output.

My understanding is that I only need to add (-dump_beam test.txt) in the command line. Based on the information on this website:
https://opennmt.net/OpenNMT-py/options/translate.html

So my full command line looks like this (in Colab)
!onmt_translate -model model_step_120000.pt -src blabla.txt -output output.txt -gpu 0 -dump_beam test.txt -verbose

but i’m only getting this error:

[2021-02-07 22:24:44,811 INFO] Translating shard 0.
Traceback (most recent call last):
File “/usr/local/bin/onmt_translate”, line 8, in
sys.exit(main())
File “/usr/local/lib/python3.6/dist-packages/onmt/bin/translate.py”, line 44, in main
translate(opt)
File “/usr/local/lib/python3.6/dist-packages/onmt/bin/translate.py”, line 28, in translate
align_debug=opt.align_debug
File “/usr/local/lib/python3.6/dist-packages/onmt/translate/translator.py”, line 412, in translate
batch, data.src_vocabs, attn_debug
File “/usr/local/lib/python3.6/dist-packages/onmt/translate/translator.py”, line 741, in translate_batch
assert not self.dump_beam
AssertionError

Note: without the dump_beam everything is working like a charm!

I thinks this was never properly implemented ([Help Wanted] Reimplement Dump_beam for beam visualization · Issue #719 · OpenNMT/OpenNMT-py · GitHub).
But there is still a pending PR. You may have a look and test it if you want. It’s quite old and may need a few adaptations to fit the latest code though.