RecursionError: Maximum recursion depth exceeded in comparison
I got this error :RecursionError: maximum recursion depth exceeded in comparisonwhen I was trying to run this line:bert = TFAutoModel.from_pretrained('bert-base-cased')Also, I increased the maximum recursion amount in sys.I wanted this to fine-tune a model.
2021-09-26T15:29:55Z
Full stack trace:RecursionError                            Traceback (most recent call last)
/tmp/ipykernel_1850345/304243349.py in <module>
      5 from transformers import AutoModel
      6 #bert = AutoModel.from_pretrained('bert-base-cased')
----> 7 bert = TFAutoModel.from_pretrained('bert-base-uncased')
      8 
      9 # we can view the model using the summary method

~/anaconda3/envs/tf2/lib/python3.7/site-packages/transformers/models/auto/auto_factory.py in from_pretrained(cls, pretrained_model_name_or_path, *model_args, **kwargs)
    385         )
    386 
--> 387 
    388 def insert_head_doc(docstring, head_doc=""):
    389     if len(head_doc) > 0:

~/anaconda3/envs/tf2/lib/python3.7/site-packages/transformers/models/auto/auto_factory.py in _get_model_class(config, model_mapping)
    334         return supported_models
    335 
--> 336     name_to_model = {model.__name__: model for model in supported_models}
    337     architectures = getattr(config, "architectures", [])
    338     for arch in architectures:

~/anaconda3/envs/tf2/lib/python3.7/site-packages/transformers/models/auto/auto_factory.py in __getitem__(self, key)

~/anaconda3/envs/tf2/lib/python3.7/site-packages/transformers/models/auto/auto_factory.py in _load_attr_from_module(self, model_type, attr)

~/anaconda3/envs/tf2/lib/python3.7/site-packages/transformers/models/auto/auto_factory.py in getattribute_from_module(module, attr)

... last 1 frames repeated, from the frame below ...

~/anaconda3/envs/tf2/lib/python3.7/site-packages/transformers/models/auto/auto_factory.py in getattribute_from_module(module, attr)

RecursionError: maximum recursion depth exceeded in comparison
2021-09-29T20:59:17Z
I got the same error when I have installed it from git source.