본문 바로가기
머신러닝

[issue] tensorflow, keras, transformer 버전 문제

by Chan_찬 2024. 3. 29.
728x90

tensorflow, keras, transformer

TypeError: Exception encountered when calling layer 'embeddings' (type TFEmbeddings).

colab, kaggle 에서 돌아가는 코드들이 로컬에서 돌리면 안돌아가는 경우가 있다.
대부분 버전문제로 아래 2줄의 코드로 해결했다.

import os
os.environ["TF_USE_LEGACY_KERAS"] = "1"

아래는 MacOS 에서 설치한 각버전

pip install tf-keras==2.16.0
pip install tensorflow-macos==2.15.0
pip install tensorflow-metal==1.1.0  # macos==2.15.0과 호환 
pip install transformers==4.39.1
728x90
728x90

'머신러닝' 카테고리의 다른 글

False Negative와 False Positive 개념 이해하기  (0) 2024.04.23
ensemble - 모델의 조합  (0) 2020.08.13
Voting / Equation - 보팅/평균화  (0) 2020.08.11
Blending - 블렌딩  (0) 2020.08.10
Stacking - 스태킹  (1) 2020.08.06
Buy me a coffeeBuy me a coffee

댓글