본문 바로가기
AI/파이토치(Pytorch)

[Pytorch][Error] ’BertTokenizerFast' object has no attribute '_in_target_context_manager'

by Hyen4110 2022. 12. 12.
반응형

Pytorch에서 Transformer 라이브러리를 사용하는데
여러 가상환경에서 테스트를 해보다가
이전에는 없었던 아래 에러가 발생하는것을 확인

’BertTokenizerFast' object has no attribute '_in_target_context_manager'

찾아보니, transformers 라이브러리 4.22.x 와 4.21.x 버전에서 같은 에러가 발생한다고함
더 낮은 버전으로 다운그레이드하여 해결

pip install --force-reinstall transformers==4.20.1

https://github.com/MaartenGr/BERTopic/issues/718#issuecomment-1248934705

 

'BertTokenizerFast' object has no attribute '_in_target_context_manager' · Issue #718 · MaartenGr/BERTopic

I am using version 0.11.0. This is a saved model and imported using BERTopic.load(), it worked fine last week and the before that. I just tried doing some work on it today and I got this error when...

github.com

 

반응형

댓글