You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have a openNMTPy model translator.pt. While converting it using ct2-opennmt-py-converter --model_path himangy_triton_repo/himangy-hi-pa/1/2.pt --output_dir ct2_model --quantization "int8" command. I get following error :-
File "/opt/anaconda3/envs/NMT/bin/ct2-opennmt-py-converter", line 8, in <module>
sys.exit(main())
File "/opt/anaconda3/envs/NMT/lib/python3.10/site-packages/ctranslate2/converters/opennmt_py.py", line 355, in main
OpenNMTPyConverter(args.model_path).convert_from_args(args)
File "/opt/anaconda3/envs/NMT/lib/python3.10/site-packages/ctranslate2/converters/converter.py", line 50, in convert_from_args
return self.convert(
File "/opt/anaconda3/envs/NMT/lib/python3.10/site-packages/ctranslate2/converters/converter.py", line 89, in convert
model_spec = self._load()
File "/opt/anaconda3/envs/NMT/lib/python3.10/site-packages/ctranslate2/converters/opennmt_py.py", line 181, in _load
check_opt(checkpoint["opt"], num_source_embeddings=len(src_vocabs))
File "/opt/anaconda3/envs/NMT/lib/python3.10/site-packages/ctranslate2/converters/opennmt_py.py", line 55, in check_opt
check.validate()
File "/opt/anaconda3/envs/NMT/lib/python3.10/site-packages/ctranslate2/converters/utils.py", line 106, in validate
raise_unsupported(self._unsupported_reasons)
File "/opt/anaconda3/envs/NMT/lib/python3.10/site-packages/ctranslate2/converters/utils.py", line 93, 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 --encoder_type and --decoder_type must be 'transformer' or 'transformer_lm
- Options --position_encoding and --max_relative_positions cannot be both enabled or both disabled
The OpenNMT version is too old. You might try an older version of CTranslate2 (two years old, if still available).
However, let's first check the errors:
Options --encoder_type and --decoder_type must be 'transformer' or 'transformer_lm
Is this model based on the Transformer architecture? If not, it is not supported by CTranslate2.
Options --position_encoding and --max_relative_positions cannot be both enabled or both disabled
If you use max_relative_positions you must set position_encoding to False during training with OpenNMT. The error started to show in 2021, and I am not sure if there was an earlier version of CTranslate2 that didn't complain about it.
With all of this in mind, there is a chance you will not be able to convert this model to CTranslate2. Currently, there are several pre-trained OPUS models, NLLB-200, and MADLAD-400, all of which are supported by CTranslate2.
I have a openNMTPy model
translator.pt
. While converting it usingct2-opennmt-py-converter --model_path himangy_triton_repo/himangy-hi-pa/1/2.pt --output_dir ct2_model --quantization "int8"
command. I get following error :-Ctranslate2 -
ctranslate2==4.3.1
OpenNMTPy -
OpenNMT-py==1.2.0
The text was updated successfully, but these errors were encountered: