fastwer icon indicating copy to clipboard operation
fastwer copied to clipboard

Seg fault with char_level=True

Open stevenhillis opened this issue 3 years ago • 1 comments

I have a list of hypotheses and a list of references. Both have one element, a string. The hypothesis string has a length of 115233. The reference string has a length of 141575. I need to compute both WER and CER. When I compute WER with fastwer.score(hyps, refs), everything is normal. But, when I compute CER with fastwer.score(hyps, refs, char_level=True), my program pauses for an unexpected period of a few seconds, then prints "Segmentation fault", and then exits.

stevenhillis avatar Jun 15 '21 22:06 stevenhillis

I had a similar issue. After looking at the source code, I guess it's out of memory error. Here it tries to allocate a vector of M*N size of int32 items. In your case, 115234 * 141575 *4 is over 60 gigabytes of memory just for this structure.

shedar avatar Dec 20 '21 05:12 shedar