Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Set position_encoding to True in transformer example config. #2087

Merged
merged 1 commit into from Aug 23, 2021
Merged

Set position_encoding to True in transformer example config. #2087

merged 1 commit into from Aug 23, 2021

Conversation

BrightXiaoHan
Copy link
Contributor

I trained a model config by examples/onmt.train.fp16.transformer.yaml. I convert trained model by command onmt_release_model -m general_en_zh_step_90000.pt -o ct2_convert --format ctranslate2 -q int8. The error raised.

Traceback (most recent call last):
  File "/home/hanbing/miniconda3/bin/onmt_release_model", line 33, in <module>
    sys.exit(load_entry_point('OpenNMT-py', 'console_scripts', 'onmt_release_model')())
  File "/home/hanbing/projects/OpenNMT-py/onmt/bin/release_model.py", line 35, in main
    quantization=opt.quantization)
  File "/home/hanbing/miniconda3/lib/python3.7/site-packages/ctranslate2/converters/converter.py", line 45, in convert
    model_spec = self._load()
  File "/home/hanbing/miniconda3/lib/python3.7/site-packages/ctranslate2/converters/opennmt_py.py", line 63, in _load
    model_spec = _get_model_spec(checkpoint["opt"])
  File "/home/hanbing/miniconda3/lib/python3.7/site-packages/ctranslate2/converters/opennmt_py.py", line 42, in _get_model_spec
    utils.raise_unsupported(reasons)
  File "/home/hanbing/miniconda3/lib/python3.7/site-packages/ctranslate2/converters/utils.py", line 16, in raise_unsupported
    raise ValueError(message)
ValueError: The model you are trying to convert is not supported by CTranslate2. We identified the following reasons:

- Options --position_encoding and --max_relative_positions cannot be both enabled or both disabled

position_encoding should be set to true in the configuration file.

@francoishernandez francoishernandez changed the title Set position_encoding to True. Set position_encoding to True in transformer example config. Aug 23, 2021
@francoishernandez francoishernandez merged commit 4cd9978 into OpenNMT:master Aug 23, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants