ERROR

AttributeError: module 'tensorflow' has no attribute 'placeholder' 오류

sooyeoon 2021. 7. 12. 20:50

기존 실행 시키려던 오류발생 코드

오류 

AttributeError: module 'tensorflow' has no attribute 'placeholder' 

 

 

 → LSTM을 이용해 training data와 test data 를 나누고 데이터를 가공하는 과정에서

텐서플로우 2버전과 1.x 버전의 기능인 tf.placeholder이 맞지 않아 사용하려는 코드에서 오류가 발생하였음

 

해결 

 tf.disable_v2_behavior()를 실행하여 tf.placeholder를 그대로 사용

 

변경한 코드

 

참고 링크

https://blog.naver.com/roqkfwkwns/222216328986