본문 바로가기

컴퓨터 관련/문제해결

Tensorflow 완전삭제 방법 및 ImportError: cannot import name 'experimental_functions_run_eagerly' from 'tensorflow.python.eager.def_function' 해결방법

728x90
반응형

원인

해당 문제는 Tensorflow Python 라이브러리에서, experimental_functions_run_eagerly 함수를 찾을 수 없어 생기는 문제다.
또한 이 방법을 통해, pip install tensorflow만으로 지울 수 없는 텐서플로를 한 번에 지울 수 있도록 만들어 준다.


해결방안

해결방법은 tensorflow와 관련된 모든 명령어를 삭제한 후, 재 설치하면 된다.

1. tensorflow와 관련된 라이브러리 찾기

# In Windows
pip list | find "tensor"

# In linux
pip list | grep "tensor"

2. tensorflow와 관련된 라이브러리 삭제

# 설치된 tensorflow 라이브러리를 보려면, pip list 명령어를 입력한다.  
pip uninstall tensorflow   
pip uninstall tensorboard   
pip uninstall tensorboard-data-server         
pip uninstall tensorboard-plugin-wit           
pip uninstall tensorflow-estimator            
pip uninstall tensorflow-intel  
pip uninstall tensorflow-io-gcs-filesystem  
pip uninstall keras

3. tensorflow 재 설치

pip install tensorflow -y
반응형