Uyifaka njani iKeras kunye neTensorFlow ukusuka kwi-backend kwi-Ubuntu

Uyifaka njani ikeras kubuntu

Emva kokugqiba Inkqubo yokuFunda ngomatshini, Bendijonge apho ndiza kuqhubeka khona. Imeko zophuhliso ezisetyenzisiweyo kwikhosi ye-Octave / Matlab prototyping ayisiyiyo into esetyenziswa ngabantu, ke kuya kufuneka utsibele uye kumgangatho ophezulu. Phakathi kwabagqatswa ekucetyiswe mna kakhulu kukuba Iikhamera, zisebenzisa umva weTensorFlow. Andizukuya nokuba iiKera zibhetele kunezinye izixhobo okanye ezinye izikhokelo okanye nokuba ukhetha iTensorFlow okanye iTherano. Ndiza kuchaza nje ukuba inokufakwa njani ku-Ubuntu.

Kuqala ndizamile ukuyifaka kumaxwebhu amaphepha asemthethweni, kwaye bekungenakwenzeka, bendihlala ndinempazamo, umbuzo ongasombululwanga. Ekugqibeleni ndaya kufuna izifundo ezithile ngendlela yokufaka iicamera ku-Ubuntu Kwaye ndichithe iintsuku ezimbini ndichitha ixesha elininzi ebusuku. Ekugqibeleni ndiyifumene kwaye ndikushiyela indlela endenze ngayo ukuba inokuthi ikulungiselele indlela.

Njengoko siza kulandela amanyathelo acetyiswa ziiwebhusayithi endikushiya kwimithombo ekupheleni kwesifundo, siza kufaka iPIP ebendingenayo, ukulawula iiphakheji. kuba ekugqibeleni Kwi-linux yile nto kanye, inkqubo yolawulo lwephakheji ebhalwe kwi-python.

Sudo apt-fumana ukufaka i-python3-pip sudo apt faka i-python-pip

Faka ubuhle usebenzisa ip3

NgeVirtualenv sinokudala imeko ebonakalayo ngePython. Singatsho ukuba imeko ebonakalayo iquka ukuhlanganisa iprojekthi apho singasebenza khona ngeephakeji ezahlukeneyo nakwiinguqulelo ezahlukeneyo.

Nazi iingxaki zokuqala eziye zavela xa ndisebenzisa i-Sudo ngesifundo endandisilandela

Iingxaki ekufakweni kwesidima

Abanye bacebisa ukucoca ifolda ye-http kwi-cache kodwa ayisebenzi. Esinye isisombululo endingasichazangayo kukusisebenzisa -H, Oko kukuthi, Sudo -H pip3 install virtualenv. Kodwa esona sisombululo silula esisebenze kwimeko yam ibikhona

faka ipayipi3 yokulungileyo

ipip3 endaweni yombhobho kuthetha ukuba siza kusebenzisa i-python 3

Kwaye siza kufaka iVirtualenvwrapper

IVirtualenvwrapper us iivithamini, yenza imisebenzi yeVirtualenv kunye noseto ngokuzenzekelayo. Isinceda ukuba senze yonke into ibe lula. Kungenxa yoko le nto siyisebenzisa.

Ukulandela amanyathelo acetyiswe zizifundo ezahlukeneyo, kwakubonakala ngathi yonke into ifakiwe kodwa xa ndandibaleka i-mkvirtualenva, lelinye lamanyathelo angezantsi, yayihlala indixelela ukuba ayiwuqapheli lo myalelo. Ekugqibeleni ndiye ndakwazi ukuyifaka kwaye ndenza i-virtuanenvwrapper isebenze ngoluhlobo.

ukufaka ipayipi enesidima

Uyifaka njani i-viralealenvwrapper

Nje ukuba sibone uHlelo .bashrc kunye kwaye siza kubeka umthombo wethu, oko kukuthi, idilesi apho sinefayile ye-viralealenvwrapper.sh

ukuthumela ngaphandle UMSEBENZI_HOME = $ IKHAYA / .virtualenvs ukuthumela ngaphandle i-PROJECT_HOME = $ IKHAYA / Umthombo ophucukileyo /home/nmorato/.local/bin/virtualenvwrapper.sh

Ezi zinto zincinci zezinto endizaziyo ukuba abantu baqala ukuziminxa ngenxa yokuba bengazi ukuba bangawenza njani loo mgca kwaye bafumane indlela eya kwifayile yabo. Ke kukho inkcazo encinci kwimifanekiso emi-4

Ungawufumana njani kwaye uwujonge njani umthombo okanye indlela yefayile

  1. Vula iNautilus, umphathi wefayile Ubuntu kwaye ucofe kwezinye iindawo. Izokubonisa i-hard drive yakho, khetha leyo ufake Ubuntu kuyo.
  2. Apha sisengcambu yenkqubo yethu. Cofa kwi-lupita engentla kwaye i-injini yokukhangela iya kubonakala.
  3. Ngenisa igama lefayile, kule meko okweeweb.sh kwaye iyakukufumana ikwinkqubo yonke
  4. Ufumana ngaphezulu, cofa kwiqhosha lasekunene kwaye unike iipropathi. Apho uya kubona indlela yayo epheleleyo. Lowo kuya kufuneka uthathe ukuguqula ifayile .ukuku

Kulungile. Nje ukuba i-.bashrc iguqulwe, yenza loo mgca kwikhonsoli, kwimeko yam

imvelaphi / ikhaya / nmorato/.local/bin/virtualenvwrapper.sh

sebenzisa i-viralealenvwrapper kwi-ubuntu

Emva kwempazamo ekuhloleni isifundo

Impazamo: i-viralealenvwrapper ayinakufumana i-valealev kumendo wakho

Kweli nqanaba kuye kwafuneka ndifake umbhobho nge

I-sudo ifake ifayile yokufaka

Enye inketho

I-sudo ifake ukufaka-faka kwakhona i-ubuhle

Senza imeko yeekera kwi-viralealenv kunye ne-viralealevvapper

Kwimeko yam ndiyibize ngokuba yi keras_tf evela kwiTensorFlow eyi-backend esiza kuyisebenzisa neKeras kwaye ndenza imeko yophuhliso.

Iimvirtualenv keras_tf-p

Ilula kakhulu. Ngale nto sele ifakiwe. Ukusukela ngoku ngalo lonke ixesha sifuna ukungena sizakungena

Umsebenzi wee keras_tf

Faka iTensor Flow

Umyalelo olula kakhulu. Inyani yile yokuba apha ndiyigcine ilula. Ukuba ujonga amaxwebhu asemthethweni, zininzi iindlela onokukhetha kuzo.

ukufakelwa kombhobho -phucula u-tensorflow

Ukujonga ukuba yonke into ihamba kakuhle siyenza kwikhonsoli

 python >>> ukungenisa i-tensorflow >>>
Ndinempazamo enxulunyaniswa nee-CPU ezindala endiza kuthetha ngazo ekugqibeleni

Faka iikera

Ukuze ufake iiKeras, kufuneka uqale ufake ezi python. Kuyenzeka ukuba uthathe ithuba lokufaka i-OpenCV ngoku, kodwa kuba andizukuyisebenzisa ngalo mzuzu andifunanga ukuyenza nzima ngakumbi.

ukufakelwa kwepayipi numpy scipy pip faka iskikit-funda umbhobho faka umqamelo umbhobho faka h5py

Kwaye ekugqibeleni emva kwako konke oku kungasentla ungagqibela ukufaka iiKeras :)

ukufakelwa kombhobho wekhamera

Sijonga ifayile ye keras.json ukusuka ~/.Iikhamera/Iikhamera.json unganqakraza ukuKhangela kwi-nautilus, umphathi wefayile Ubuntu

Amaxabiso asisiseko kufuneka afane noku

{"floatx": "float32", "epsilon": 1e-07, "backend": "tensorflow", "image_data_format": "channels_last"}

Ngaphezulu kwayo yonke into ejonge emva tensorflow kwaye akunjalo ithiyono kwaye yintoni umfanekiso_data_format obeka kuyo indlela_yokugqibela kwaye hayi iitshaneli_yokuqala ngu theano

Ukuba awufumani keras.json

Uninzi lwexesha leefayile ze-keras.json kunye nemithombo yayo engezantsi ayizukudala de uvula ikhonsoli kwaye ungenise iphakheji ngokuthe ngqo.
Ke ukuba le yimeko yakho kwaye awukwazi ukuyifumana kwinkqubo yakho, landela amanyathelo alandelayo.
I-workon keras_tf python yokungenisa iikhamera zokuyeka ()

indlela yokwehla usiya kwi-tensrorflow, ingxaki ngemiyalelo ye-avx

Jonga kwakhona kunye nomlingo !!! Ngoku iyavela.

Ukuba yonke into ihamba kakuhle. Uya kuba nayo yonke into ekulungeleyo, ungaqala ukusebenzisa iiKeras kwaye wonwabele ukuFunda ngomatshini, ukufunda okunzulu, ubukrelekrele bokuzenzela, ...

Ndinengxaki eyongezelelweyo eya kuthi inciphise ukusetyenziswa kweTensorFlow. Jonga umfanekiso kwaye uza kubona ukuba umgca wokugqibela ngumyalelo ongekho mthethweni ('undoqo' owenziweyo) ngesiNgesi sisiseko esilahliweyo.

Ingxaki ngeTensorFlow kunye nemiyalelo ye-AVX. I-TensorFlow ilahliwe

Kubonakala ngathi iinguqulelo ze-TensorFlow ezenziwe kwangaphambili ezingaphezulu kwe-1.5 zisebenzisa imiyalelo ye-AVX engaxhaswanga zii-CPU ezindala. Emva kokukhangela kunye nokukhangela, esona sisombululo ndisifumeneyo kukuphuphuma kokuhamba, apho bathi kufuneka sihlale kuhlobo 1.5

Ke kuye kwafuneka ndithotye indawo ukusuka kwiTensorFlow ukuya kwi-1.5 Ukuba unengxaki efanayo nale yenziwe ngayo

ukufakelwa kombhobho tensorflow == 1.5

Kwaye ngoku?

Kulungile into yokuqala kukuvavanya iiKera, ukuba zisebenza njani, ukuba ndiyayimisa okanye ayi. Ukuba ndiza kwenza iimvavanyo kuphela okanye ndiza kuyisebenzisa inyani ekusombululeni iingxaki. Inyani yile yokuba iiKeras zahluke ngokupheleleyo kusetyenziso endilwenzileyo lweOctave / Matlab kwikhosi yokufunda ngomatshini. NgeeKera, kukuba kubonakala ngathi ii-algorithms aziziboni nokubabona, sele uzifakile kwaye uzinikezela ekubekeni. Ukuba ndiqhubeka nayo ukufunda ngomatshini, kwaye ndifuna isixhobo esinamandla ngakumbi mhlawumbi ndinokukhetha iinkonzo zefu apho iiKera zimiselwe kwangaphambili njenge-AWS, Azure, google ilifu, njl.

Kodwa oku ndikushiya ngelinye ixesha. Ndihamba inyathelo ngenyathelo.

Imithombo:

Ukuba ungumntu ongaphumliyo njengathi kwaye ufuna ukusebenzisana ekugcinweni nasekuphuculweni kweprojekthi, unokwenza umnikelo. Yonke imali iya kuthenga iincwadi kunye nezixhobo zokuvavanya kunye nokwenza izifundo

Shiya amazwana