kaggle ~ RuntimeError: DGL requires tensorflow>=2.2.0 for the official DLPack support. 에러와 해결방법
문제. 오류 내용. tensorflow 버전이 다름
/opt/conda/lib/python3.6/site-packages/dgl/backend/tensorflow/tensor.py in <module>
17 if not os.getenv("USE_TFDLPACK", False):
18 if LooseVersion(tf.__version__) < LooseVersion("2.2.0"):
---> 19 raise RuntimeError("DGL requires tensorflow>=2.2.0 for the official DLPack support.")
20
21 def zerocopy_to_dlpack(data):
RuntimeError: DGL requires tensorflow>=2.2.0 for the official DLPack support.
Kaggle에서 dgl 관련 라이브러리를 실행시키려고 했는데, 이 에러가 나타났다.
RuntimeError: DGL requires tensorflow>=2.2.0 for the official DLPack support.
tf 명령어를 통해 현재 시스템의 tensorflow 버전을 확인해본 결과
2.1.0 버전이 설치되어 있었다. tensorflow를 업데이트할 필요가 있었다.
해결방법: pip install tensorflow==2.2.0 and restart
해결방법은 kaggle notebook을 기준으로 작성했다.
1. 먼저 !pip install tensorflow==2.2.0 을 실행한다.
!pip install tensorflow==2.2.0
약 3~5분 정도 걸린다.
2. Run -> Restart & clear cell outputs
다 끝났어도 아직 tf.__version__은 2.1.0일 것이다. 이 노트북 자체를 다시 실행해야 반영된다.
메뉴에서 Run > Restart & clear cell outputs 를 누른다.
그러면 모든 내용이 다 초기화 되고 노트북이 다시 실행된다.
주의할 점은 Factory reset / stop session을 하면 tensorflow를 설치한 것도 날라가므로 주의!
결론 :
1. !pip install tensorflow=2.2.0
2. Run > Restart & clear cell outputs