Deeppavlov 0.15 and latest transformers

Dear all,

Is it possible to use the latest transformers with deeppavlov 0.15? I get the following error with torch_transformers_classifier, which is resolved only if I downgrade to transformers==3.4.0.

Traceback (most recent call last): File "/path//lib/python3.7/runpy.py", line 193, in _run_module_as_main "__main__", mod_spec) File "/path//lib/python3.7/runpy.py", line 85, in _run_code exec(code, run_globals) File "/path//lib/python3.7/site-packages/deeppavlov/__main__.py", line 4, in <module> main() File "/path//lib/python3.7/site-packages/deeppavlov/deep.py", line 85, in main start_epoch_num=args.start_epoch_num) File "/path//lib/python3.7/site-packages/deeppavlov/core/commands/train.py", line 121, in train_evaluate_model_from_config trainer.train(iterator) File "/path//lib/python3.7/site-packages/deeppavlov/core/trainers/nn_trainer.py", line 337, in train self.train_on_batches(iterator) File "/path//lib/python3.7/site-packages/deeppavlov/core/trainers/torch_trainer.py", line 41, in train_on_batches super(TorchTrainer, self).train_on_batches(iterator=iterator) File "/path//lib/python3.7/site-packages/deeppavlov/core/trainers/nn_trainer.py", line 283, in train_on_batches self.last_result = self._chainer.train_on_batch(x, y_true) File "/path//lib/python3.7/site-packages/deeppavlov/core/common/chainer.py", line 169, in train_on_batch return component.train_on_batch(*preprocessed) File "/path//lib/python3.7/site-packages/deeppavlov/models/torch_bert/torch_transformers_classifier.py", line 121, in train_on_batch loss.backward() AttributeError: 'str' object has no attribute 'backward'

Best
Panagiotis

Hey @papadako ,

Unfortunately this is the case for now, new upcoming version of DeepPavlov 0.16 will support the most recent transformer. I believe it will be available in a week.

1 Like