파이썬(Python)/파이썬 기본 정리

[python] tensorflow 설치 오류 해결

sunning 2022. 7. 16. 12:41
728x90
반응형

저번 글에서 tensorflow.contrib 모듈 오류를 해결하기 위해 tensorflow 버전을 2.2.0에서 1.15.0으로 낮춰주었다.

그리고 import tensorflow as tf를 실행하자마자 새로운 오류를 마주하였다.

다시보아도 아찔한 엄청난 양의 무언가ㅎ

 

 

요약하면 TypeError가 발생하였다는 것 같다.

 

TypeError: Descriptors cannot not be created directly.
If this call came from a _pb2.py file, your generated code is out of date and must be regenerated with protoc >= 3.19.0.
If you cannot immediately regenerate your protos, some other possible workarounds are:
 1. Downgrade the protobuf package to 3.20.x or lower.
 2. Set PROTOCOL_BUFFERS_PYTHON_IMPLEMENTATION=python (but this will use pure-Python parsing and will be much slower).

 

열심히 구글링을 하여 anaconda prompt 창에서 아래와 같이 protobuf 패키지를 3.20.x 이하로 다운그레이드 해보았다.

 

pip install protobuf==3.20.*

 

 

다운그레이드 후 python에서 tensorflow를 import 해보니 문제없이 정상적으로 작동하였다.

정말 텐서플로우 오류지옥은 끝이 없다...!!

728x90
반응형