Cov txheej txheem:

Kev Paub Duab Nrog TensorFlow ntawm Raspberry Pi: 6 Cov Kauj Ruam
Kev Paub Duab Nrog TensorFlow ntawm Raspberry Pi: 6 Cov Kauj Ruam

Video: Kev Paub Duab Nrog TensorFlow ntawm Raspberry Pi: 6 Cov Kauj Ruam

Video: Kev Paub Duab Nrog TensorFlow ntawm Raspberry Pi: 6 Cov Kauj Ruam
Video: UA KAWG PEEV XWM -May maylee [official] New Song/MV/VDO 2024, Hlis ntuj nqeg
Anonim
Kev Paub Duab Nrog TensorFlow ntawm Raspberry Pi
Kev Paub Duab Nrog TensorFlow ntawm Raspberry Pi

Google TensorFlow yog Open-Source software Library rau Numerical Computation siv cov ntaub ntawv ntws kab. Nws tau siv los ntawm Google ntawm nws ntau yam haujlwm ntawm Machine Learning thiab Deep Technology Technologies. TensorFlow tau pib tsim los ntawm Google Lub Hlwb Pab Pawg thiab nws tau tshaj tawm rau pej xeem sau zoo li GitHub.

Yog xav paub ntau ntxiv mus saib peb qhov blog. Tau Txais Raspberry Pi los ntawm FactoryForward - Pom Zoo Tus Muag Khoom hauv Is Nrias teb.

Nyeem cov ntawv qhia no ntawm peb blog ntawm no.

Kauj Ruam 1: Kev Kawm Tshuab

Kev Kawm Tshuab thiab Kev Kawm Dhau yuav los nyob rau hauv Artificial Intelligence (AI). Kev Kawm Tshuab yuav soj ntsuam thiab txheeb xyuas cov ntaub ntawv muaj thiab txhim kho nws cov txiaj ntsig dhau lub sijhawm.

Piv txwv: YouTube Pom zoo cov yeeb yaj kiab tshwj xeeb. Nws qhia txog cov vis dis aus cuam tshuam uas koj tau saib ua ntej. Kev twv ua ntej tsuas yog siv cov ntsiab lus raws cov ntawv. Tab sis kev kawm tob tuaj yeem tob dua qhov no.

Kauj Ruam 2: Kev Kawm tob

Kev kawm tob yog yuav luag zoo ib yam rau qhov ntawd, tab sis nws txiav txim siab qhov tseeb ntawm nws tus kheej los ntawm kev sau ntau cov ntaub ntawv ntawm ib yam khoom. Nws muaj ntau txheej kev tshuaj xyuas thiab txiav txim siab raws li nws. Txhawm rau txheej txheem nrawm, nws siv Neural Network thiab muab peb qhov txiaj ntsig tau txais txiaj ntsig ntau dua uas peb xav tau (txhais tau tias yog kwv yees zoo dua li ML). Ib yam zoo li cas tib neeg lub hlwb xav thiab txiav txim siab.

Piv txwv: Kev txheeb xyuas qhov khoom. Nws kuaj pom tias muaj dab tsi hauv daim duab. Ib yam zoo sib xws uas koj tuaj yeem sib txawv ntawm Arduino thiab Raspberry Pi los ntawm nws qhov tsos, qhov loj me thiab xim.

Nws yog lub ncauj lus dav thiab muaj ntau daim ntawv thov.

Kauj ruam 3: Pre-Requisites

TensorFlow tshaj tawm kev txhawb nqa rau Raspberry Pi, los ntawm Version 1.9 nws yuav txhawb nqa Raspberry Pi siv pip pob installation. Peb yuav pom yuav ua li cas rau nruab nws ntawm peb Raspberry Pi hauv qhov kev qhia no.

  • Nab hab sej 3.4 (pom zoo)
  • Raspberry Pi
  • Hwj chim Mov
  • Raspbian 9 (Ncab)

Kauj Ruam 4: Hloov Kho Koj Raspberry Pi thiab Nws Cov Pob

Kauj Ruam 1: Hloov Kho Koj Raspberry Pi thiab nws cov pob.

sudo apt-tau hloov tshiab

sudo apt-tau hloov tshiab

Kauj Ruam 2: Ntsuas tias koj muaj cov nab npawb tshiab kawg, siv cov lus txib no.

python3 vers- rov

Nws raug pom zoo kom muaj tsawg kawg Python 3.4.

Kauj Ruam 3: Peb yuav tsum teeb tsa lub tsev qiv ntawv libatlas (ATLAS - Tau Txais Kho Li Qub Linear Algebra Software). Vim tias TensorFlow siv tus lej. Yog li, nruab nws siv cov lus txib hauv qab no

sudo apt nruab libatlas-base-dev

Kauj Ruam 4: Nruab TensorFlow siv Pip3 teeb tsa hais kom ua.

pip3 nruab tensorflow

Tam sim no TensorFlow tau teeb tsa.

Kauj Ruam 5: Kwv yees Duab Siv Imagenet Tus Qauv Piv Txwv:

Predicting tus duab Siv Imagenet Qauv Piv Txwv
Predicting tus duab Siv Imagenet Qauv Piv Txwv

TensorFlow tau tshaj tawm tus qauv los kwv yees cov duab. Koj yuav tsum rub tus qauv ua ntej ces khiav nws.

Kauj ruam 1: Khiav cov lus txib hauv qab no txhawm rau rub tawm cov qauv. Koj yuav xav tau kev teeb tsa git.

git clone

Kauj ruam 2: Mus rau qhov piv txwv piv txwv.

cd qauv/tutorials/duab/imagenet

Cov Lus Qhia Pro: Ntawm qhov Raspbian Stretch tshiab, koj tuaj yeem pom cov 'classify_image.py' cov ntaub ntawv manually thiab tom qab ntawd 'Txoj Cai Nyem' rau nws. Xaiv 'Copy Path (s)'. Tom qab ntawv muab nws tso rau hauv lub davhlau ya nyob twg tom qab 'cd' thiab nias nkag mus. Los ntawm txoj hauv kev no koj tuaj yeem taug kev sai dua yam tsis muaj qhov yuam kev (thaum ntawv sau tsis raug lossis lub npe cov ntaub ntawv raug hloov pauv tshiab).

Kuv siv 'Copy Path (s)' txoj kev yog li nws yuav suav nrog txoj hauv kev ntawm daim duab (/home/pi).

Kauj Ruam 3: Khiav qhov piv txwv siv cov lus txib no. Nws yuav siv sijhawm li 30 feeb los qhia qhov kev twv ua ntej.

python3 classify_image.py

Kauj Ruam 6: Kev Txheeb Duab Tshwj Xeeb

Kev Cai Duab Ua Ntej
Kev Cai Duab Ua Ntej

Koj tseem tuaj yeem rub tawm daim duab los ntawm is taws nem lossis siv koj tus kheej lub duab tua ntawm koj lub koob yees duab rau kev kwv yees. Kom tau txais txiaj ntsig zoo dua siv cov duab nco tsawg dua.

Txhawm rau siv cov duab coj los siv, siv cov hauv qab no. Kuv muaj daim duab duab ntawm qhov chaw '/home/pi/Downloads/TensorImageTest1.jpg'. Tsuas yog hloov qhov no nrog koj cov ntaub ntawv qhov chaw nyob thiab lub npe. Siv 'Copy Path (s)' kom yooj yim dua kev qhia.

python3 classify_image.py --image_file =/home/pi/Downloads/TensorImageTest1.jpg

Koj tuaj yeem sim ua lwm yam piv txwv ib yam nkaus. Tab sis koj yuav tsum teeb tsa pob khoom tsim nyog ua ntej ua tiav. Peb yuav npog qee cov ntsiab lus TensorFlow nthuav tawm hauv cov ntawv qhia tom ntej.

Pom zoo: