티스토리 뷰
728x90
출처
- Installing the Latest Python 3.7 on Ubuntu 16.04 | 18.04 | Website for Students
- 리눅스 CPU 정보 확인하기
- permissions - How to change zram size? - Ask Ubuntu
- ./tensorflow/lite/tools/make/download_dependencies.sh: line 59: 1: Usage: download_and_extract URL DIR · Issue #36199 · tensorflow/tensorflow
리눅스 정보 확인
HW 정보 확인
$ sudo apt-get install lshw $ sudo lshw bananapim2zero description: Computer width: 32 bits *-core description: Motherboard physical id: 0 *-memory description: System memory physical id: 0 size: 495MiB *-cpu:0 physical id: 1 bus info: cpu@0 size: 1008MHz capacity: 1008MHz capabilities: cpufreq *-cpu:1 physical id: 2 bus info: cpu@1 size: 1008MHz capacity: 1008MHz capabilities: cpufreq *-cpu:2 physical id: 3 bus info: cpu@2 size: 1008MHz capacity: 1008MHz capabilities: cpufreq *-cpu:3 physical id: 4 bus info: cpu@3 size: 1008MHz capacity: 1008MHz capabilities: swp half thumb fastmult vfp edsp thumbee neon vfpv3 tls vfpv4 idiva idivt cpufreq *-usbhost:0 product: SW USB2.0 'Open' Host Controller (OHCI) Driver vendor: Linux 3.4.113-sun8i ohci_hcd physical id: 1 bus info: usb@2 logical name: usb2 version: 3.04 capabilities: usb-1.10 configuration: driver=hub slots=1 speed=12Mbit/s *-usbhost:1 product: SW USB2.0 'Enhanced' Host Controller (EHCI) Driver vendor: Linux 3.4.113-sun8i ehci_hcd physical id: 2 bus info: usb@1 logical name: usb1 version: 3.04 capabilities: usb-2.00 configuration: driver=hub slots=1 speed=480Mbit/s *-usb description: USB hub product: USB 2.0 Hub vendor: Terminus Technology Inc. physical id: 1 bus info: usb@1:1 version: 1.11 capabilities: usb-2.00 configuration: driver=hub maxpower=100mA slots=4 speed=480Mbit/s *-usb:0 description: Keyboard product: Smart Control vendor: HL 0000 00 00 00 01 physical id: 1 bus info: usb@1:1.1 version: 1.00 capabilities: usb-1.10 configuration: driver=usbhid maxpower=200mA speed=12Mbit/s *-usb:1 description: Generic USB device product: USB 2.0 10/100M Ethernet Adaptor vendor: Kontron (Industrial Computer Source / ICS Advent) physical id: 2 bus info: usb@1:1.2 version: 1.01 capabilities: usb-1.10 configuration: driver=qf9700 maxpower=120mA speed=12Mbit/s *-network:0 description: Wireless interface physical id: 3 logical name: wlan0 serial: cc:b8:a8:aa:b7:b4 capabilities: ethernet physical wireless configuration: broadcast=yes driver=wl driverversion=0 multicast=yes wireless=IEEE 802.11 *-network:1 description: Ethernet interface physical id: 4 logical name: eth0 serial: 7a:24:59:9a:a1:b8 size: 10Mbit/s capacity: 100Mbit/s capabilities: ethernet physical tp mii 10bt 10bt-fd 100bt 100bt-fd autonegotiation configuration: autonegotiation=on broadcast=yes driver=sunxi_geth driverversion=SUNXI Gbgit driver V1.1 duplex=half link=no multicast=yes port=MII speed=10Mbit/s *-network:2 description: Ethernet interface physical id: 5 logical name: enx00e04c534458 serial: 00:e0:4c:53:44:58 size: 100Mbit/s capacity: 100Mbit/s capabilities: ethernet physical tp mii 10bt 10bt-fd 100bt 100bt-fd autonegotiation configuration: autonegotiation=on broadcast=yes driver=qf9700 driverversion=22-Aug-2005 duplex=full firmware=QF9700 USB Ethernet ip=192.168.0.3 link=yes multicast=yes port=MII speed=100Mbit/s
instruction set architecture (ISA)
$ uname -i armv7l
swap 사이즈 설정
현재 swap 사이즈 확인
$ free -h total used free shared buff/cache available Mem: 495M 129M 136M 19M 228M 324M Swap: 247M 0B 247M $ sudo swapon -s Filename Type Size Used Priority /dev/zram0 partition 63376 0 5 /dev/zram1 partition 63376 0 5 /dev/zram2 partition 63376 0 5 /dev/zram3 partition 63376 0 5 $ sudo swapoff /dev/zram0 $ sudo swapoff /dev/zram1 $ sudo swapoff /dev/zram2 $ sudo swapoff /dev/zram3 $ sudo zramctl --reset /dev/zram0 $ sudo zramctl --reset /dev/zram1 $ sudo zramctl --reset /dev/zram2 $ sudo zramctl --reset /dev/zram3 $ sudo zramctl --find --size 512M /dev/zram0 $ sudo zramctl --find --size 512M /dev/zram1 $ sudo zramctl --find --size 512M /dev/zram2 $ sudo zramctl --find --size 512M /dev/zram3 $ sudo mkswap /dev/zram0 Setting up swapspace version 1, size = 512 MiB (536866816 bytes) no label, UUID=db53f0c1-5ca4-41cb-acae-ba8c61e17827 $ sudo mkswap /dev/zram1 Setting up swapspace version 1, size = 512 MiB (536866816 bytes) no label, UUID=f2b75b1c-77e6-485d-adfa-df2f3a7abc01 $ sudo mkswap /dev/zram2 Setting up swapspace version 1, size = 512 MiB (536866816 bytes) no label, UUID=9612064a-508e-4c7f-8f7f-07d1a5cbe79d $ sudo mkswap /dev/zram3 Setting up swapspace version 1, size = 512 MiB (536866816 bytes) no label, UUID=cc344046-c130-4f79-9d33-fc0882cf3f6a $ sudo swapon /dev/zram0 $ sudo swapon /dev/zram1 $ sudo swapon /dev/zram2 $ sudo swapon /dev/zram3 $ free -h total used free shared buff/cache available Mem: 495M 134M 132M 19M 228M 319M Swap: 2.0G 0B 2.0G $ sudo swapon -s Filename Type Size Used Priority /dev/zram0 partition 524284 0 -1 /dev/zram1 partition 524284 0 -2 /dev/zram2 partition 524284 0 -3 /dev/zram3 partition 524284 0 -4
Bazel 설치
출처 : トマト農家のロボット創り Robot creation by tomato farmer: Build Bazel(0.29.0) on Raspberry Pi 4
JDK 설치
$ sudo apt install openjdk-8-jdk
Bazel 다운로드 및 설치
$ mkdir bazel $ cd bazel $ wget https://github.com/bazelbuild/bazel/releases/download/0.29.1/bazel-0.29.1-dist.zip $ unzip bazel-0.29.1-dist.zip $ sudo env EXTRA_BAZEL_ARGS="--host_javabase=@local_jdk//:jdk" VERBOSE=yes BAZEL_JAVAC_OPTS="-J-Xms384m -J-Xmx1024m" bash ./compile.sh $ sudo cp output/bazel /usr/local/bin/bazel
Tensorflow Lite 빌드
Tensorflow 소스 다운로드
$ wget https://github.com/tensorflow/tensorflow/archive/v2.1.0.tar.gz $ tar -zxvf v2.1.0.tar.gz $ cd tensorflow-2.1.0/
Tensorflow Lite 빌드
$ tensorflow/lite/tools/make/download_dependencies.sh tensorflow/lite/tools/make/download_dependencies.sh: line 59: 1: Usage: download_and_extract URL DIR pi@bananapim2zero:~/tensorflow-2.1.0$ $ sed -i "/^EIGEN_URL=/c\EIGEN_URL=\"\$(grep -o 'https://storage.googleapis.com/mirror.tensorflow.org/gitlab.com/libeigen/eigen/.*tar.gz' \"\${BZL_FILE_PATH}\")\"" tensorflow/lite/tools/make/download_dependencies.sh $ tensorflow/lite/tools/make/download_dependencies.sh
컴파일 옵션 변경
BPI-M2 ZERO 리소스 부족으로 컴파일 오류가 발생하므로 컴파일 옵션 변경
$ vi tensorflow/lite/tools/make/build_lib.sh
-j 옵션값을 4에서 2로 변경
make -j 2 BUILD_WITH_NNAPI=false -C "${TENSORFLOW_DIR}" -f tensorflow/lite/tools/make/Makefile
Tensorflow Lite 빌드
$ sudo tensorflow/lite/tools/make/build_lib.sh + set -e +++ dirname tensorflow/lite/tools/make/build_lib.sh ++ cd tensorflow/lite/tools/make ++ pwd + SCRIPT_DIR=/home/pi/tensorflow-2.1.0/tensorflow/lite/tools/make + TENSORFLOW_DIR=/home/pi/tensorflow-2.1.0/tensorflow/lite/tools/make/../../../.. + make -j 4 BUILD_WITH_NNAPI=false -C /home/pi/tensorflow-2.1.0/tensorflow/lite/tools/make/../../../.. -f tensorflow/lite/tools/make/Makefile make: Entering directory '/home/pi/tensorflow-2.1.0'
Python 패키지 빌드, 설치
$ sudo apt install swig $ tensorflow/lite/tools/pip_package/build_pip_package.sh $ pip3 install /tmp/tflite_pip/python3/dist/tflite_runtime-2.1.0-cp37-cp37m-linux_armv7l.whl Defaulting to user installation because normal site-packages is not writeable Processing /tmp/tflite_pip/python3/dist/tflite_runtime-2.1.0-cp37-cp37m-linux_armv7l.whl Requirement already satisfied: numpy>=1.12.1 in /home/pi/.local/lib/python3.7/site-packages (from tflite-runtime==2.1.0) (1.18.2) Installing collected packages: tflite-runtime Successfully installed tflite-runtime-2.1.0
댓글
300x250
공지사항
최근에 올라온 글
최근에 달린 댓글
- Total
- Today
- Yesterday
TAG
- Spring MVC
- 서울오토살롱
- Xcode
- NDK
- 튜닝쇼 2008
- Java
- SAS
- 전예희
- 송주경
- android
- ffmpeg
- Delphi Tip
- MySQL
- 레이싱모델 익스트림 포토 페스티벌
- 일본여행
- 동경
- ble
- oracle
- Spring
- Delphi
- Linux
- ubuntu
- flex
- sas2009
- JavaScript
- Mac
- KOBA
- koba2010
- 지스타2007
- BPI-M4
일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
1 | 2 | 3 | 4 | |||
5 | 6 | 7 | 8 | 9 | 10 | 11 |
12 | 13 | 14 | 15 | 16 | 17 | 18 |
19 | 20 | 21 | 22 | 23 | 24 | 25 |
26 | 27 | 28 | 29 | 30 | 31 |
글 보관함