Data Engineering/머신러닝, AI
[tensorflow error] module 'tensorflow' has no attribute 'random_uniform'
쟈누
2020. 9. 9. 01:14
반응형
위 에러는 tensorflow 가 2.0 으로 넘어오면서 생긴 에러이다.
2.0 이전에 random_uniform( ) 으로 랜덤으로 수를 생성해 주었다면
2.0 으로 넘어오면서 명칭이 바뀌어 random.uniform( ) 으로 써야 한다.
아래와 같이 써주면 해결이 가능하다.
a = tf.Variable(tf.random.uniform([1], 0, 10, dtype = tf.float64, seed = 0))
b = tf.Variable(tf.random.uniform([1], 0, 10, dtype = tf.float64, seed = 0))
자세한 사항은 아래
링크 참고
dev-pengun.tistory.com/entry/python-tensorflow-trouble-shooting
python tensorflow trouble shooting
텐서플로우 2.0이 깔려있는데 현존하는 문서는 1버전을 기준으로 한게 많기때문에, 그냥 실행하면 에러가 자주 난다. 재설치는 귀찮기때문에 import할 때 이렇게 해주면 v1로 사용이 가능하다. impor
dev-pengun.tistory.com
반응형