Hello,
I’m getting an error when the model gets evaluated and it try to export.
I believe the only thing I changed since last training (which was working) was to export it has ctranslate2_int8 to save MBs.
Note: If i restart the training, it will restart where it failed and crach again at the next export.
see error:
2022-01-07 23:54:08.210000: I training.py:192] Evaluation result for step 1000: loss = 3.287896 ; perplexity = 26.786436 ; wer = 0.789772
2022-01-07 23:54:08.215000: I training.py:192] Exporting model to gdrive/MyDrive/VGR/PREP/eng-lin/v1/OpenNMT/export/1000 (best wer so far: 0.789772)
Traceback (most recent call last):
File "/usr/local/bin/onmt-main", line 8, in <module>
sys.exit(main())
File "/usr/local/lib/python3.7/dist-packages/opennmt/bin/main.py", line 312, in main
hvd=hvd,
File "/usr/local/lib/python3.7/dist-packages/opennmt/runner.py", line 284, in train
moving_average_decay=train_config.get("moving_average_decay"),
File "/usr/local/lib/python3.7/dist-packages/opennmt/training.py", line 135, in __call__
evaluator, step, moving_average=moving_average
File "/usr/local/lib/python3.7/dist-packages/opennmt/training.py", line 192, in _evaluate
evaluator(step)
File "/usr/local/lib/python3.7/dist-packages/opennmt/evaluation.py", line 355, in __call__
self._maybe_export(step, results)
File "/usr/local/lib/python3.7/dist-packages/opennmt/evaluation.py", line 384, in _maybe_export
self._model.export(export_dir, exporter=self._exporter)
File "/usr/local/lib/python3.7/dist-packages/opennmt/models/model.py", line 406, in export
exporter.export(self, export_dir)
File "/usr/local/lib/python3.7/dist-packages/opennmt/utils/exporters.py", line 21, in export
self._export_model(model, export_dir)
File "/usr/local/lib/python3.7/dist-packages/opennmt/utils/exporters.py", line 166, in _export_model
model_spec = model.ctranslate2_spec
File "/usr/local/lib/python3.7/dist-packages/opennmt/models/transformer.py", line 174, in ctranslate2_spec
alignment_heads=self._alignment_heads,
TypeError: __init__() got an unexpected keyword argument 'alignment_layer'
Here my training and saving config:
train:
save_checkpoints_steps: 500
batch_type: tokens
#0 automaticaly find the highest number
batch_size: 0
#max_step: 500000
#single_pass: true
# (optional) How many checkpoints to keep on disk.
keep_checkpoint_max: 2
average_last_checkpoints: 4
#effective_batch_size: 1
#maximum number of tokens
maximum_features_length: 2500
maximum_labels_length: 2500
eval:
steps: 500
scorers: wer
export_on_best: wer
save_eval_predictions: true
export_format: ctranslate2_int8
max_exports_to_keep: 2
early_stopping:
metric: loss
steps: 4