OS/Raspberry Pi

Raspberry Pi 4 : TensorFlow 2.2.0 (armv7l) 설치 (Python 3.7)

파란크리스마스 2020. 5. 8. 01:04
728x90

출처

리눅스 정보 확인

CPU 정보 확인

$ cat /proc/cpuinfo
processor       : 0
model name      : ARMv7 Processor rev 3 (v7l)
BogoMIPS        : 108.00
Features        : half thumb fastmult vfp edsp neon vfpv3 tls vfpv4 idiva idivt vfpd32 lpae evtstrm crc32 
CPU implementer : 0x41
CPU architecture: 7
CPU variant     : 0x0
CPU part        : 0xd08
CPU revision    : 3
 
 ... 생략 ...
 
Hardware        : BCM2835
Revision        : b03112
Serial          : 10000000xxxxxxxx
Model           : Raspberry Pi 4 Model B Rev 1.2

instruction set architecture (ISA)

$ uname -m
armv7l

커널에 대한 정보

$ uname -a
Linux raspberrypi 4.19.97-v7l+ #1294 SMP Thu Jan 30 13:21:14 GMT 2020 armv7l GNU/Linux

OS버전에 대한 정보

$ cat /etc/issue
Raspbian GNU/Linux 10 \n \l

논리 코어 수 확인

$ grep -c processor /proc/cpuinfo
4

메모리, swap 사이즈 확인

$ free -h
              total        used        free      shared  buff/cache   available
Mem:          1.9Gi       145Mi       1.0Gi        42Mi       751Mi       1.6Gi
Swap:          99Mi          0B        99Mi

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

$ sudo apt update
$ sudo apt install gfortran libopenblas-dev liblapack-dev libhdf5-dev
$ pip3 --version
pip 18.1 from /usr/lib/python3/dist-packages/pip (python 3.7)

TensorFlow 2.2.0 패키지 설치

TensorFlow 2.2.0 패키지 다운로드

$ wget http://1.229.109.140:3562/tensorflow/tensorflow-2.2.0.armv7l/tensorflow-2.2.0-cp37-none-linux_armv7l.whl

tensorflow 2.2.0 파이썬 페키지 설치

$ pip3 install tensorflow-2.2.0-cp37-none-linux_armv7l.whl
 
 ... 생략 ...
 
Successfully installed absl-py-0.9.0 astunparse-1.6.3 cachetools-4.1.0 gast-0.3.3 google-auth-1.14.2 google-auth-oauthlib-0.4.1 google-pasta-0.2.0 grpcio-1.28.1 h5py-2.10.0 keras-preprocessing-1.1.0 markdown-3.2.1 opt-einsum-3.2.1 protobuf-3.11.3 pyasn1-0.4.8 pyasn1-modules-0.2.8 rsa-4.0 scipy-1.4.1 setuptools-46.1.3 tensorboard-2.2.1 tensorboard-plugin-wit-1.6.0.post3 tensorflow-2.2.0 tensorflow-estimator-2.2.0 termcolor-1.1.0 wrapt-1.12.1

버전 확인

$ python3
Python 3.7.3 (default, Dec 20 2019, 18:57:59) 
[GCC 8.3.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import tensorflow as tf
>>> tf.__version__
'2.2.0'