머신러닝 & 텐서플로 & 파이썬
텐서플로우 동작 확인
하늘을 나는 미카
2017. 11. 23. 16:15
반응형
우선 tensorflow 를 activate 시킵니다.
~$source ~/tensorflow/bin/activate
(tensorflow)~$
아 첫 실행이네요. !! 두근두근!!
일단 예제 file을 하나 만들죠!! python 으로 테스트용 소스코드를 작성 했습니다.
hello.py
import tensorflow as tf
hello = tf.constant ("hello, tensorflow!!!")
sess = tf.Session()
print(sess.run(hello))
그리고 나서 실행
(tensorflow)~$ python3 hello.py
2017-11-23 16:13:38.323733: I tensorflow/core/platform/cpu_feature_guard.cc:137] Your CPU supports instructions that this TensorFlow binary was not compiled to use: SSE4.1 SSE4.2 AVX
b'hello, tensorflow!!!'
결과는 이렇게 나왔습니다.
중간에 "TensorFlow binary was not compiled to use: SSE4.1 SSE4.2 AVX" 이런 메세지가 나오는데 이건 따로 찾아봐야 겠네요.
이 메세지는 CPU 에서 지원하는 기능을 제대로 사용하지 못하는 binary를 사용했다 것이라서, CPU/ GPU에 맞는 binary를 잘 찾아서 처리해야 겠네요.
하지만, 테스트 해보는데는 문제가 없었습니다.