본문 바로가기
  • 경제적 자유를 얻는 그날까지
엔지니어링/인공지능

[ 머신러닝 예제 ] MacOS에 python 텐서플로우 설치환경 구축

by 베니스상인 2021. 12. 17.

 

 

1.  아나콘다를 설치한다.

  • 아나콘다는 파이썬 개발환경이 구축이 되어 있는 라이브러리이다. 아나콘다를 사용하면 다양한 파이썬 라이브러리를 사용할 있다.
  • 설치 사이트는 아래를 참고하여 설치
  • MacOS사용자는 MacOS용을 선택하고 Command로 설치하면 된다.

https://www.anaconda.com/products/individual

 

Anaconda | Individual Edition

Anaconda's open-source Individual Edition is the easiest way to perform Python/R data science and machine learning on a single machine.

www.anaconda.com

 

2. 텐서 플로우 설치

  • python을 실행하여 자신의 python버전을 확인한다.
  • 자신의 버전에 맞는 텐서플로우의 작업공간을 생성한다.
(base) swiftui-MacBook-Pro:~ swift$ conda create -n tf2 python=3.9.7

 

  • python을 실행하고 텐서플로우를 설치한다.
(base) swiftui-MacBook-Pro:~ swift$ conda activate tf2
(tf2) swiftui-MacBook-Pro:~ swift$ pip install tensorflow

 

 

 

3. 텐서플로우 활성화

  • 한번 설치가 되었으면 터미널을 설치 결과를 확인한다.
>>> import tensorflow as tf
>>> hello = tf.print("Hello")
2021-12-17 16:45:48.726377: I tensorflow/core/platform/cpu_feature_guard.cc:151] This TensorFlow binary is optimized with oneAPI Deep Neural Network Library (oneDNN) to use the following CPU instructions in performance-critical operations:  AVX2 FMA
To enable them in other operations, rebuild TensorFlow with the appropriate compiler flags.
Hello
>>>

 

 

 

 

728x90

댓글