Using self-implemented encoder in training config

I implemented a new Seq2SeqEncoder class so that I can use it in my model. Even if I register the class as Seq2SeqEncoder, allennlp train does not allow me to use it in a config file. The error message showed that I can only choose from a specific set including rnn, lstm, feedforward, etc. Is it currently not possible to use a self-implemented encoder in config files? Or did I possibly register the encoder incorrectly? Thanks.

Hi @seanhung21, you’ll need to pass the package where you define your encoder to allennlp train with --include-package. Otherwise the code we never even be loaded and, hence, not registered. Let me know if that doesn’t work!

Hi @brendan, thanks for your reply. The error I mentioned occurred even though I trained with --include-package.

Hmm, strange. Could you please provide the exact command line you used?