學習DeepLearning的初學者心得 - 3C

By Leila
at 2017-08-17T02:33
at 2017-08-17T02:33
Table of Contents
※如果DL的全貌是馬里安納海溝,
※那我大概正在游泳池游泳。
我用的是python3+tensorflow+keras,
先寫個簡單的建置歷程 證明不是鍵盤大師。
如果你是個只會用windows的人,
(修改一下)注意底下:
Windows用python3.6,
tensorflow安裝會有問題,
我移掉3.6再裝3.5.2還是會掛,
要重灌windows再裝3.5.2才正常import。
※(如果你是個不用花一個禮拜以上時間,
※就可以獨自在windows上跑gpu加速的人,
※那我想拜你為師)
如果你會用Vim寫程式,
那這篇請當作笑話略過。
如果你不知道指令cd,ls在幹嘛?
那請先了解Linux的檔案架構跟windows的差異。
如果不會用nano寫個python的開圖程式,
那請先看看vim怎麼操作,然後你會對nano很有親切感。
還有把tensorflow裝好後用matplotlib秀張圖出來。
如果不知道該怎麼開始DL的學習,
那請在github上找個簡單的CNN模型下來跑跑看,先看看別人是怎麼做的。
上面寫了我目前建置過程中的大部分keywords,事後有想到再補充。
~~~
有人說deep learning用cpu跑是開玩笑,
就我個人一個多月以來學習經驗,
這一半是開玩笑沒錯,但另一半不是。
直接講用cpu跟gpu的比較好了,
GPU優點:
快,就是快,2,3小時的train幾十分鐘就完成。
只用CPU優點:
簡單,建置快速。
初學者我強烈建議先在VM中安裝Ubuntu,
裝在VM中就不能用GPU加速了,
可初學者就不要妄想用什麼GPU了。
CPU都沒搞定還想用GPU?
※如果你真的很想用GPU加速某個model,那這篇也不是你需要看的。
用VM的好處:
裝完環境之後你可以直接匯出虛擬機當作備份,
避免新手的強力技能:[把環境崩潰掉]後,
要重新安裝系統的麻煩事。
而且可以安裝一次,創建好幾台虛擬機,
而不用準備一堆實體電腦,
去測試各種環境變數,套件的相容性,跟一堆雜七雜八的問題。
高手會用virtualenv創建不同的虛擬環境,
避免不小心搞掛系統這件事。
不過,連virtualBox都不會用的話,
我是不覺得會用virtualenv。
~~~
安裝tensrflow-cpu
就把官網的指令複製貼上,大概4個步驟,含下載15分鐘完成。
安裝tensorflow-gpu
需要CUDA® Toolkit 8.0
需要cuDNN v5.1.
以上兩個就是安裝gpu版最累人的地方,第一次我至少花了兩天時間,
NVIDIA的安裝說明我一直沒有去看懂,
試著在k600上安裝時,被煩倒在設定環境變數的部份,就不想搞了。
安裝完上面兩個後,就跟安裝cpu版是幾乎一樣的指令了。
~~~
就目前為止,用gpu的好處,
我只想到加快train,跟使用的速度,
DL的學習重點跟順序,
著重於: linux操作 〉python 〉
tensorflow跟keras 〉深度學習理論,
而且深度學習的理論非常非常非常重要!!!
除此之外,
我是不覺得gpu加速能幫助多少一個人學習DL的速度加快。
要學DL就該學DL的理論,
DL的理論不只要人聰明,還要大量時間,
寫好model後,就丟給底下的人去測試,
學DL不要把時間花在建環境上。
學DL不要把時間花在建環境上。
學DL不要把時間花在建環境上。
除非你像我一樣這麼苦命,
整個系上沒人會python,懂linux操作。
(修改)純CPU不適合:
用DL工作的人,
有人處理演算法,自己只負責測試的人,
用CPU處理的時間超過可接受的時間的人
(我的話,train的上限大概是10~14天,因為要做報告)
~~~
我推薦的DL學習最低建議:
I3,I5
(I7有點~不是那麼必要。)
32GB以上記憶體
(我目前試過約8個model,有兩個會用超過14GB記憶體,因為是在虛擬機內所以是14G不是16G
SSD
(這個看個人,因為我的數據經常要自己挑出來需要的,1萬多張300KB圖片用arc100都要好幾分鐘才能讀完縮圖)
顯卡:看看口袋多深買多貴,我只有朋友送的兩張K600。
~~~
對了,用CPU還有個好處,
可以跟Boss說東西還在跑,
進度報告先跳過我。
(deadline快到的人不適用)
~~~(新增:有錯請指教)
在windows上裝anaconda
建置GPU加速環境應該是最簡便的,
但我還沒試。
新手在Ubuntu 搞NV-GPU加速是在自虐,
不過有不少Library在windows上會很難搞。
--
Tags:
3C
All Comments

By Damian
at 2017-08-21T11:03
at 2017-08-21T11:03

By Zenobia
at 2017-08-25T20:40
at 2017-08-25T20:40

By Daniel
at 2017-08-27T10:30
at 2017-08-27T10:30

By Olivia
at 2017-08-30T06:45
at 2017-08-30T06:45

By Belly
at 2017-09-01T00:48
at 2017-09-01T00:48

By Oliver
at 2017-09-01T15:32
at 2017-09-01T15:32

By Joe
at 2017-09-02T15:17
at 2017-09-02T15:17

By Harry
at 2017-09-06T13:14
at 2017-09-06T13:14

By Edwina
at 2017-09-07T10:04
at 2017-09-07T10:04

By Selena
at 2017-09-09T13:04
at 2017-09-09T13:04

By Genevieve
at 2017-09-11T18:14
at 2017-09-11T18:14

By Hedwig
at 2017-09-14T08:25
at 2017-09-14T08:25

By James
at 2017-09-16T12:14
at 2017-09-16T12:14

By Dinah
at 2017-09-20T00:23
at 2017-09-20T00:23

By Odelette
at 2017-09-20T02:34
at 2017-09-20T02:34

By Puput
at 2017-09-20T07:46
at 2017-09-20T07:46

By Tracy
at 2017-09-21T10:17
at 2017-09-21T10:17

By Isabella
at 2017-09-25T00:44
at 2017-09-25T00:44

By Blanche
at 2017-09-27T20:31
at 2017-09-27T20:31

By Sierra Rose
at 2017-09-29T21:06
at 2017-09-29T21:06

By Iris
at 2017-10-01T15:28
at 2017-10-01T15:28

By Candice
at 2017-10-05T04:06
at 2017-10-05T04:06

By Franklin
at 2017-10-09T21:41
at 2017-10-09T21:41

By Margaret
at 2017-10-12T11:57
at 2017-10-12T11:57

By Iris
at 2017-10-17T02:38
at 2017-10-17T02:38

By Andrew
at 2017-10-19T16:26
at 2017-10-19T16:26

By Gary
at 2017-10-20T20:36
at 2017-10-20T20:36

By Jake
at 2017-10-23T07:50
at 2017-10-23T07:50

By Jake
at 2017-10-26T11:33
at 2017-10-26T11:33

By Sierra Rose
at 2017-10-30T21:37
at 2017-10-30T21:37

By Leila
at 2017-11-01T05:09
at 2017-11-01T05:09

By Victoria
at 2017-11-06T00:43
at 2017-11-06T00:43

By Cara
at 2017-11-07T16:06
at 2017-11-07T16:06

By Olive
at 2017-11-12T12:26
at 2017-11-12T12:26

By Elvira
at 2017-11-13T00:09
at 2017-11-13T00:09

By Belly
at 2017-11-14T16:08
at 2017-11-14T16:08

By Necoo
at 2017-11-18T10:26
at 2017-11-18T10:26

By Caitlin
at 2017-11-18T22:41
at 2017-11-18T22:41

By Linda
at 2017-11-20T23:06
at 2017-11-20T23:06

By Bennie
at 2017-11-23T00:05
at 2017-11-23T00:05

By Leila
at 2017-11-25T23:55
at 2017-11-25T23:55

By Kama
at 2017-11-27T18:54
at 2017-11-27T18:54

By Gilbert
at 2017-11-28T15:42
at 2017-11-28T15:42

By Connor
at 2017-12-02T15:23
at 2017-12-02T15:23

By Kyle
at 2017-12-07T14:50
at 2017-12-07T14:50

By Joe
at 2017-12-10T12:52
at 2017-12-10T12:52

By Oliver
at 2017-12-11T07:53
at 2017-12-11T07:53

By Frederic
at 2017-12-13T09:53
at 2017-12-13T09:53

By Anonymous
at 2017-12-14T23:55
at 2017-12-14T23:55

By Puput
at 2017-12-18T02:06
at 2017-12-18T02:06

By Puput
at 2017-12-20T19:47
at 2017-12-20T19:47

By Robert
at 2017-12-23T03:26
at 2017-12-23T03:26

By Adele
at 2017-12-28T02:23
at 2017-12-28T02:23

By Edward Lewis
at 2017-12-28T08:17
at 2017-12-28T08:17

By Hardy
at 2017-12-30T13:48
at 2017-12-30T13:48

By Regina
at 2018-01-01T21:36
at 2018-01-01T21:36

By Carolina Franco
at 2018-01-06T17:04
at 2018-01-06T17:04

By Hedwig
at 2018-01-09T11:14
at 2018-01-09T11:14

By Delia
at 2018-01-11T22:18
at 2018-01-11T22:18

By Eden
at 2018-01-13T03:45
at 2018-01-13T03:45

By Una
at 2018-01-13T09:05
at 2018-01-13T09:05

By Hedwig
at 2018-01-14T16:03
at 2018-01-14T16:03

By Hedwig
at 2018-01-19T13:06
at 2018-01-19T13:06

By Daniel
at 2018-01-23T01:42
at 2018-01-23T01:42

By Michael
at 2018-01-26T13:11
at 2018-01-26T13:11

By Faithe
at 2018-01-28T09:34
at 2018-01-28T09:34

By Edward Lewis
at 2018-01-31T17:16
at 2018-01-31T17:16

By Hamiltion
at 2018-02-01T13:13
at 2018-02-01T13:13

By Carolina Franco
at 2018-02-03T17:01
at 2018-02-03T17:01

By Oscar
at 2018-02-08T12:10
at 2018-02-08T12:10

By Frederic
at 2018-02-12T21:41
at 2018-02-12T21:41

By Charlie
at 2018-02-14T09:12
at 2018-02-14T09:12

By Brianna
at 2018-02-15T10:32
at 2018-02-15T10:32

By Isabella
at 2018-02-19T23:47
at 2018-02-19T23:47

By Isla
at 2018-02-22T05:02
at 2018-02-22T05:02

By Candice
at 2018-02-25T18:00
at 2018-02-25T18:00

By Ula
at 2018-03-01T14:59
at 2018-03-01T14:59

By Quintina
at 2018-03-06T10:20
at 2018-03-06T10:20

By Oliver
at 2018-03-10T12:27
at 2018-03-10T12:27

By Hedy
at 2018-03-11T23:05
at 2018-03-11T23:05

By Rebecca
at 2018-03-12T13:38
at 2018-03-12T13:38

By Robert
at 2018-03-12T23:07
at 2018-03-12T23:07

By Lauren
at 2018-03-14T02:34
at 2018-03-14T02:34

By Frederica
at 2018-03-16T18:17
at 2018-03-16T18:17

By Kristin
at 2018-03-20T12:04
at 2018-03-20T12:04

By Harry
at 2018-03-23T03:49
at 2018-03-23T03:49

By Hedy
at 2018-03-24T22:10
at 2018-03-24T22:10

By Jacob
at 2018-03-26T09:14
at 2018-03-26T09:14

By Rae
at 2018-03-29T13:32
at 2018-03-29T13:32

By Hardy
at 2018-04-01T20:09
at 2018-04-01T20:09

By Jacob
at 2018-04-06T12:19
at 2018-04-06T12:19

By Agnes
at 2018-04-09T15:01
at 2018-04-09T15:01

By Enid
at 2018-04-11T21:03
at 2018-04-11T21:03

By Daph Bay
at 2018-04-16T03:26
at 2018-04-16T03:26

By Charlotte
at 2018-04-21T03:05
at 2018-04-21T03:05

By Faithe
at 2018-04-23T02:08
at 2018-04-23T02:08

By Daniel
at 2018-04-24T22:12
at 2018-04-24T22:12

By Hazel
at 2018-04-29T00:15
at 2018-04-29T00:15

By Skylar Davis
at 2018-05-02T14:21
at 2018-05-02T14:21

By Sarah
at 2018-05-03T12:11
at 2018-05-03T12:11

By Kumar
at 2018-05-05T17:40
at 2018-05-05T17:40

By Elvira
at 2018-05-10T07:36
at 2018-05-10T07:36

By Oscar
at 2018-05-13T03:26
at 2018-05-13T03:26

By Carol
at 2018-05-17T06:31
at 2018-05-17T06:31

By Oscar
at 2018-05-20T08:49
at 2018-05-20T08:49

By Andy
at 2018-05-22T13:18
at 2018-05-22T13:18

By Irma
at 2018-05-23T02:15
at 2018-05-23T02:15

By Freda
at 2018-05-23T19:10
at 2018-05-23T19:10

By Brianna
at 2018-05-25T05:37
at 2018-05-25T05:37

By Blanche
at 2018-05-26T23:08
at 2018-05-26T23:08

By Jacky
at 2018-05-31T08:02
at 2018-05-31T08:02

By Isabella
at 2018-05-31T22:27
at 2018-05-31T22:27

By Kumar
at 2018-06-02T19:44
at 2018-06-02T19:44

By Charlotte
at 2018-06-06T10:11
at 2018-06-06T10:11

By Todd Johnson
at 2018-06-10T03:43
at 2018-06-10T03:43

By Barb Cronin
at 2018-06-11T08:51
at 2018-06-11T08:51

By David
at 2018-06-14T05:43
at 2018-06-14T05:43

By Queena
at 2018-06-18T02:11
at 2018-06-18T02:11

By Connor
at 2018-06-21T02:55
at 2018-06-21T02:55

By Oscar
at 2018-06-26T00:07
at 2018-06-26T00:07

By Jack
at 2018-06-29T17:54
at 2018-06-29T17:54

By Christine
at 2018-07-03T12:23
at 2018-07-03T12:23

By Ursula
at 2018-07-04T23:56
at 2018-07-04T23:56

By Delia
at 2018-07-07T23:25
at 2018-07-07T23:25

By Sarah
at 2018-07-10T20:57
at 2018-07-10T20:57

By Rosalind
at 2018-07-15T01:33
at 2018-07-15T01:33

By Annie
at 2018-07-18T10:20
at 2018-07-18T10:20

By Sierra Rose
at 2018-07-22T14:29
at 2018-07-22T14:29

By Ingrid
at 2018-07-24T05:54
at 2018-07-24T05:54

By Andy
at 2018-07-28T17:59
at 2018-07-28T17:59

By Tristan Cohan
at 2018-08-01T20:47
at 2018-08-01T20:47

By Una
at 2018-08-05T21:57
at 2018-08-05T21:57

By Rosalind
at 2018-08-08T06:15
at 2018-08-08T06:15

By Eden
at 2018-08-11T16:13
at 2018-08-11T16:13

By Bethany
at 2018-08-13T01:45
at 2018-08-13T01:45

By Vanessa
at 2018-08-17T13:18
at 2018-08-17T13:18

By Edwina
at 2018-08-19T07:42
at 2018-08-19T07:42

By John
at 2018-08-23T18:19
at 2018-08-23T18:19

By James
at 2018-08-26T15:17
at 2018-08-26T15:17

By Zanna
at 2018-08-30T14:00
at 2018-08-30T14:00

By Valerie
at 2018-09-02T03:45
at 2018-09-02T03:45

By Isla
at 2018-09-03T09:32
at 2018-09-03T09:32

By Suhail Hany
at 2018-09-07T10:00
at 2018-09-07T10:00

By Robert
at 2018-09-09T00:33
at 2018-09-09T00:33

By Odelette
at 2018-09-13T06:03
at 2018-09-13T06:03
Related Posts
舊電腦升級 GTA5/H1Z1/Gigantic

By Linda
at 2017-08-17T00:22
at 2017-08-17T00:22
VEGA 和 Fury 同頻性能比較

By Isla
at 2017-08-17T00:16
at 2017-08-17T00:16
AMD B350M M-ATX選擇

By Rachel
at 2017-08-17T00:03
at 2017-08-17T00:03
ROG規格功能擴充到位STRIX X370F GAMING

By Oliver
at 2017-08-16T23:14
at 2017-08-16T23:14
品牌文書機 二選一

By Delia
at 2017-08-16T22:41
at 2017-08-16T22:41