學習筆記GAN001:生成式對抗網絡,只需10步,從零開始到調試


生成式對抗網絡(gennerative adversarial network,GAN),目前最火的非監督深度學習。一個生成網絡無中生有,一個判別網絡推動進化。學技術,不先着急看書看文章。先把Demo跑起來,順利進入斷點調試。這樣就可以邊學習邊修改邊驗證,親自下手參與調試,會比只是當個看客,更有興趣更有成就感也更容易理解內容。

1、下載並安裝Anaconda。
https://www.continuum.io/downloads

Anaconda的使用可以看這篇文章:
http://www.jianshu.com/p/2f3be7781451

2、創建環境,指定Python版本

conda create --name python36 python=3.6

3、使用activate激活環境

source activate python36

4、安裝依賴庫

pip install bleach certifi chardet decorator html5lib idna imageio markdown moviepy numpy olefile pillow protobuf scipy requests six tensorflow tensorflow-tensorboard tqdm urllib3 werkzeug

5、用git clone DCGAN-tensorflow 源碼

git clone https://github.com/carpedm20/DCGAN-tensorflow.git

6、進入 DCGAN-tensorflow 目錄

cd XXX/DCGAN-tensorflow

7、下載mnist數據集

python download.py mnist

8、訓練模型

python main.py --dataset mnist --input_height=28 --output_height=28 --train

9、測試模型

python main.py --dataset mnist --input_height=28 --output_height=28

10、斷點調試

http://wx1.sinaimg.cn/mw1024/8cdf76c6gy1fix2mx8ocjj21kw102trw.jpg

歡迎付費咨詢(150元每小時),我的微信:qingxingfengzi


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM