kzl / decision-transformer

Official codebase for Decision Transformer: Reinforcement Learning via Sequence Modeling.
MIT License
2.33k stars 440 forks source link

TypeError on trajectory_gpt2.py #31

Closed dljzx closed 2 years ago

dljzx commented 2 years ago

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

Altrouge7 commented 1 year ago

@dljzx w do you solve this problem?

arks22 commented 9 months ago

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.