텐서플로는 딥러닝을 위한 프레임워크로 많이들 접해봤을 파이토치(PyTorch)와 케라스(Keras)와 같이 전세계적으로 많이 사용되고 있습니다.
텐서플로는 파이썬(Python)과 C++ API를 기본적으로 제공하고 있습니다!
저는 현재 M1 pro Apple Silicon을 사용하고 있으므로 MacOS 기준으로 텐서플로를 설치하였습니다.
애플에서 지원하는 내용을 참고하여 작성합니다!
(참고 : https://developer.apple.com/metal/tensorflow-plugin)
(참고 : https://www.tensorflow.org/install/docker)
(추가참고 : https://developer.apple.com/forums/thread/721619 )
Metal Overview - Apple Developer
Metal powers hardware-accelerated graphics on Apple platforms by providing a low-overhead API, rich shading language, tight integration between graphics and compute, and an unparalleled suite of GPU profiling and debugging tools.
developer.apple.com
⭐️ 설치방법
- https://repo.anaconda.com/miniconda/Miniconda3-latest-MacOSX-arm64.sh 으로 접속해 Miniconda를 다운로드 합니다. Downloads파일에 다운 받아주세요!
- Commad + Space를 누르시면 검색창이 나오는데 "터미널" 이나 "Terminal" 입력후 아래 코드 입력해주세요.
chmod +x ~/Downloads/Miniforge3-MacOSX-arm64.sh
sh ~/Downloads/Miniforge3-MacOSX-arm64.sh
source ~/miniforge3/bin/activate
3. conda를 이용해 가상환경을 생성하고 활성화합니다. (conda env list 명령어를 통해 가상환경 확인)
conda create --name mytensorflow python=3.8
conda env list
conda activate mytensorflow
4. MacOS용 텐서플로와 플러그인을 설치해줍니다. (단 특정 버전에서 오류가 존재하여 해당 버전으로 설치하였습니다)
conda install -c apple tensorflow-deps
python -m pip install tensorflow-macos==2.9
python -m pip install tensorflow-metal==0.5.0
5. python을 실행시켜 잘 작동하는지 확인해봅시다!
python
import tensorflow as tf
print(tf.reduce_sum(tf.random.normal([1000,1000])))
다들 성공적으로 설치가 되셨으면 좋겠습니다!
'AI > Deep Learning' 카테고리의 다른 글
| [Tensorflow] 3. 분류 (Classification) (0) | 2023.01.07 |
|---|---|
| [Tensorflow] 2-1 Regression with Boston housing datasets (0) | 2023.01.07 |
| [Tensorflow] 2. 회귀(Regression) (0) | 2023.01.05 |
| [Tensorflow] 1. 논리연산을 위한 신경망 네트워크 생성 (0) | 2023.01.04 |
| [Tensorflow] 0. 신경망 네트워크의 구성 (0) | 2023.01.04 |