lvapeab / nmt-keras

Neural Machine Translation with Keras
http://nmt-keras.readthedocs.io
MIT License
533 stars 130 forks source link

AssertionError: Reduction function "Noam" unimplemented! #135

Closed stribizhev closed 4 years ago

stribizhev commented 4 years ago

I am trying to train a Transformer model using the /nmt-keras/examples/configs/config_transformer.py. After modifying the variables with my task name and data corpus path, and replacing the config.py in the /nmt-keras directory with this updated transformer config, I get

Traceback (most recent call last):
  File "main.py", line 53, in <module>
    train_model(parameters, args.dataset)
  File "/nmt-keras/nmt_keras/training.py", line 173, in train_model
    nmt_model.trainNet(dataset, training_params)
  File "/nmt-keras/multimodal_keras_wrapper/keras_wrapper/cnn_model.py", line 667, in trainNet
    params)
  File "/nmt-keras/multimodal_keras_wrapper/keras_wrapper/cnn_model.py", line 745, in __train
    verbose=params['verbose'])
  File "/nmt-keras/multimodal_keras_wrapper/keras_wrapper/extra/callbacks.py", line 1081, in __init__
    raise AssertionError('Reduction function "%s" unimplemented!' % str(self.reduction_function))
AssertionError: Reduction function "Noam" unimplemented!

Is that expected? How shall I train a Transformer using Keras-NMT?

lvapeab commented 4 years ago

Thanks for the catch. It should be 'noam' (all lowercased). I've updated the example config.