BPI-M4 : TensorFlow 2.2.0 (aarch64) 설치 (Python 3.7)

OS/Banana Pi /BPI-Bit 2020. 6. 6. 09:16 Posted by 파란크리스마스

출처

리눅스 정보 확인

CPU 정보 확인

$ cat /proc/cpuinfo
processor       : 0
BogoMIPS        : 54.00
Features        : fp asimd evtstrm aes pmull sha1 sha2 crc32
CPU implementer : 0x41
CPU architecture: 8
CPU variant     : 0x0
CPU part        : 0xd03
CPU revision    : 4
 
... 생략 ...
i

nstruction set architecture (ISA)

$ uname -i
aarch64

커널에 대한 정보

$ uname -a
Linux bpi-iot-ros-ai 4.9.119-BPI-M4-Kernel #1 SMP PREEMPT Mon May 18 10:41:36 HKT 2020 aarch64 aarch64 aarch64 GNU/Linux

OS버전에 대한 정보

$ cat /etc/issue
Ubuntu 18.04.4 LTS \n \l

논리 코어 수 확인

$ grep -c processor /proc/cpuinfo
4

메모리, swap 사이즈 확인

$ free -h
              total        used        free      shared  buff/cache   available
Mem:           1.5G        236M        533M         33M        802M        1.0G
Swap:            0B          0B          0B

관련 라이브러리 설치, pip3 설치 확인

$ sudo apt update
$ sudo apt install gfortran libopenblas-dev liblapack-dev libhdf5-dev
$ pip3 --version
pip 20.1.1 from /usr/local/lib/python3.7/site-packages/pip (python 3.7)

TensorFlow 2.2.0 패키지 설치

TensorFlow 2.2.0 패키지 다운로드

$ wget https://github.com/lhelontra/tensorflow-on-arm/releases/download/v2.2.0/tensorflow-2.2.0-cp37-none-linux_aarch64.whl

tensorflow 2.2.0 파이썬 페키지 설치

$ export TMPDIR=/var/tmp
$ pip3 install tensorflow-2.2.0-cp37-none-linux_aarch64.whl
Defaulting to user installation because normal site-packages is not writeable
Processing ./tensorflow-2.2.0-cp37-none-linux_aarch64.whl
Requirement already satisfied: opt-einsum>=2.3.2 in ./.local/lib/python3.7/site-packages (from tensorflow==2.2.0) (3.2.1)
Requirement already satisfied: numpy<2.0,>=1.16.0 in ./.local/lib/python3.7/site-packages (from tensorflow==2.2.0) (1.18.5)
Requirement already satisfied: grpcio>=1.8.6 in ./.local/lib/python3.7/site-packages (from tensorflow==2.2.0) (1.29.0)
Requirement already satisfied: termcolor>=1.1.0 in ./.local/lib/python3.7/site-packages (from tensorflow==2.2.0) (1.1.0)
Requirement already satisfied: tensorflow-estimator<2.3.0,>=2.2.0 in ./.local/lib/python3.7/site-packages (from tensorflow==2.2.0) (2.2.0)
Requirement already satisfied: h5py<2.11.0,>=2.10.0 in ./.local/lib/python3.7/site-packages (from tensorflow==2.2.0) (2.10.0)
Requirement already satisfied: wrapt>=1.11.1 in ./.local/lib/python3.7/site-packages (from tensorflow==2.2.0) (1.12.1)
Requirement already satisfied: absl-py>=0.7.0 in ./.local/lib/python3.7/site-packages (from tensorflow==2.2.0) (0.9.0)
Requirement already satisfied: keras-preprocessing>=1.1.0 in ./.local/lib/python3.7/site-packages (from tensorflow==2.2.0) (1.1.2)
Requirement already satisfied: protobuf>=3.8.0 in ./.local/lib/python3.7/site-packages (from tensorflow==2.2.0) (3.12.2)
Requirement already satisfied: gast==0.3.3 in ./.local/lib/python3.7/site-packages (from tensorflow==2.2.0) (0.3.3)
Requirement already satisfied: astunparse==1.6.3 in ./.local/lib/python3.7/site-packages (from tensorflow==2.2.0) (1.6.3)
Requirement already satisfied: scipy==1.4.1; python_version >= "3" in ./.local/lib/python3.7/site-packages (from tensorflow==2.2.0) (1.4.1)
Requirement already satisfied: tensorboard<2.3.0,>=2.2.0 in ./.local/lib/python3.7/site-packages (from tensorflow==2.2.0) (2.2.2)
Requirement already satisfied: wheel>=0.26; python_version >= "3" in /usr/local/lib/python3.7/site-packages (from tensorflow==2.2.0) (0.34.2)
Requirement already satisfied: google-pasta>=0.1.8 in ./.local/lib/python3.7/site-packages (from tensorflow==2.2.0) (0.2.0)
Requirement already satisfied: six>=1.12.0 in ./.local/lib/python3.7/site-packages (from tensorflow==2.2.0) (1.15.0)
Requirement already satisfied: setuptools in /usr/local/lib/python3.7/site-packages (from protobuf>=3.8.0->tensorflow==2.2.0) (47.1.1)
Requirement already satisfied: google-auth<2,>=1.6.3 in ./.local/lib/python3.7/site-packages (from tensorboard<2.3.0,>=2.2.0->tensorflow==2.2.0) (1.16.1)
Requirement already satisfied: tensorboard-plugin-wit>=1.6.0 in ./.local/lib/python3.7/site-packages (from tensorboard<2.3.0,>=2.2.0->tensorflow==2.2.0) (1.6.0.post3)
Requirement already satisfied: werkzeug>=0.11.15 in ./.local/lib/python3.7/site-packages (from tensorboard<2.3.0,>=2.2.0->tensorflow==2.2.0) (1.0.1)
Requirement already satisfied: requests<3,>=2.21.0 in ./.local/lib/python3.7/site-packages (from tensorboard<2.3.0,>=2.2.0->tensorflow==2.2.0) (2.23.0)
Requirement already satisfied: markdown>=2.6.8 in ./.local/lib/python3.7/site-packages (from tensorboard<2.3.0,>=2.2.0->tensorflow==2.2.0) (3.2.2)
Requirement already satisfied: google-auth-oauthlib<0.5,>=0.4.1 in ./.local/lib/python3.7/site-packages (from tensorboard<2.3.0,>=2.2.0->tensorflow==2.2.0) (0.4.1)
Requirement already satisfied: rsa<4.1,>=3.1.4 in ./.local/lib/python3.7/site-packages (from google-auth<2,>=1.6.3->tensorboard<2.3.0,>=2.2.0->tensorflow==2.2.0) (4.0)
Requirement already satisfied: cachetools<5.0,>=2.0.0 in ./.local/lib/python3.7/site-packages (from google-auth<2,>=1.6.3->tensorboard<2.3.0,>=2.2.0->tensorflow==2.2.0) (4.1.0)
Requirement already satisfied: pyasn1-modules>=0.2.1 in ./.local/lib/python3.7/site-packages (from google-auth<2,>=1.6.3->tensorboard<2.3.0,>=2.2.0->tensorflow==2.2.0) (0.2.8)
Requirement already satisfied: certifi>=2017.4.17 in ./.local/lib/python3.7/site-packages (from requests<3,>=2.21.0->tensorboard<2.3.0,>=2.2.0->tensorflow==2.2.0) (2020.4.5.1)
Requirement already satisfied: idna<3,>=2.5 in ./.local/lib/python3.7/site-packages (from requests<3,>=2.21.0->tensorboard<2.3.0,>=2.2.0->tensorflow==2.2.0) (2.9)
Requirement already satisfied: chardet<4,>=3.0.2 in ./.local/lib/python3.7/site-packages (from requests<3,>=2.21.0->tensorboard<2.3.0,>=2.2.0->tensorflow==2.2.0) (3.0.4)
Requirement already satisfied: urllib3!=1.25.0,!=1.25.1,<1.26,>=1.21.1 in ./.local/lib/python3.7/site-packages (from requests<3,>=2.21.0->tensorboard<2.3.0,>=2.2.0->tensorflow==2.2.0) (1.25.9)
Requirement already satisfied: importlib-metadata; python_version < "3.8" in ./.local/lib/python3.7/site-packages (from markdown>=2.6.8->tensorboard<2.3.0,>=2.2.0->tensorflow==2.2.0) (1.6.1)
Requirement already satisfied: requests-oauthlib>=0.7.0 in ./.local/lib/python3.7/site-packages (from google-auth-oauthlib<0.5,>=0.4.1->tensorboard<2.3.0,>=2.2.0->tensorflow==2.2.0) (1.3.0)
Requirement already satisfied: pyasn1>=0.1.3 in ./.local/lib/python3.7/site-packages (from rsa<4.1,>=3.1.4->google-auth<2,>=1.6.3->tensorboard<2.3.0,>=2.2.0->tensorflow==2.2.0) (0.4.8)
Requirement already satisfied: zipp>=0.5 in ./.local/lib/python3.7/site-packages (from importlib-metadata; python_version < "3.8"->markdown>=2.6.8->tensorboard<2.3.0,>=2.2.0->tensorflow==2.2.0) (3.1.0)
Requirement already satisfied: oauthlib>=3.0.0 in ./.local/lib/python3.7/site-packages (from requests-oauthlib>=0.7.0->google-auth-oauthlib<0.5,>=0.4.1->tensorboard<2.3.0,>=2.2.0->tensorflow==2.2.0) (3.1.0)
Installing collected packages: tensorflow
Successfully installed tensorflow-2.2.0

버전 확인

$ python3
Python 3.7.7 (default, Jun  6 2020, 12:24:50) 
[GCC 7.5.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import tensorflow as tf
>>> tf.__version__
'2.2.0'

댓글을 달아 주세요

  1. 형님 2021.05.13 19:31  댓글주소  수정/삭제  댓글쓰기

    형님 제 목숨을 구하셨습니다.