kzl/decision-transformer

TypeError on trajectory_gpt2.py

Closed this issue · 2 comments

dljzx commented

When I ran experiment.py, it comes out an error with:

File "D:\ReinformentLearning\decision-transformer-master\gym\decision_transformer\models\trajectory_gpt2.py", line 590, in GPT2Model
config_class=_CONFIG_FOR_DOC,
TypeError: add_code_sample_docstrings() got an unexpected keyword argument 'tokenizer_class'

I guess it should be the problem of different versions of transformer, but I cannot solve.

Thanks

@dljzx w do you solve this problem?

This problem is caused by using a different version of transformers.
You can solve this problem by installing transformers==4.5.1 or by manually changing the tokenizer_class to processor_class.
However, it is recommended to use 4.5.1 as specified in this repository, as using a different version of transformers will cause a new error elsewhere.