Error with latest CTranslate2 version in OpenNMT-py REST server

Hi @guillaumekln,

I tried replying in the other topic but it is blocked.

I managed to compile Ctranslate2 with CUDA=10.1 and installing it in the Python virtual environment. When running onmt_server I get the following error:

File "/home/venv/lib/python3.6/site-packages/onmt/translate/", line 116, in <listcomp>
    scores = [[item["score"] for item in ex] for ex in preds]
KeyError: 'score'

It seems there is still a mismatch in the installation


Please create a new topic for each of your issue. The topic Simple OpenNMT-py REST server should be for general discussion about the server, not specific issues.

To fix this error you should install the latest OpenNMT-py commit:

For example by running:

pip install

pip install OpenNMT-py
does not include that commit yet?

Got it! Somewhere I did not have the latest version of OpenNMT-py.

pip install OpenNMT-py --upgrade solved it

Thanks for your patience.