How to specify the number of layers for Transformer in OpenNMT-tf with Tensorflow 2?

Hi all,

I’m trying to train 2 models with different number of layers, I can do this easilly when I was using OpenNMT-py with Tensorflow 1.14, now I have upgraded to Tensorflow 2 and OpenNMT-tf, the only command I found is something like this:
onmt-main --model_type Transformer --config data.yml --auto_config train
I found there’s no way to specify those parameters, not even in the data.yml file

Can anyone help me with this?


Non standard models should be defined in custom model definition files, see the documentation at