Pix2Pix Z圖像翻譯系統(自制)

說說作者

作者於2019年暑假開始,對人工智能就產生了濃厚的興趣。於是經過一個月的考察結果,初步瞭解人工智能模型;於2019年9月份開始着手學習GANs(對抗式生成網絡)。爲什麼會有這樣的一個系統呢?由於本人畢竟是本科生,文采平平;寫不出研究生水平的文章來,於是結合原理以及經過部分微調的優化得到了由Django來驅動使用tensorflow2.0所編寫並且經過微調的Pix2Pix模型進行圖像翻譯訓練和翻譯。
在此,首先感謝一下kaggle這個網站解決了我們這種學習人工智能的學子在沒有GPU資源下的苦惱。

說說應用

目前未開源,如若需要可以聯繫作者(郵箱爲:[email protected])。

安裝anaconda

人工智能必備,anaconda優勢在於可以隨時創建python虛擬環境;切來切去非常方便,而且有一個conda庫。下載對應版本,然後next、next…

設置anaconda國內源

清華源:

conda config --add channels https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/free/
conda config --add channels https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/conda-forge 
conda config --add channels https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/msys2/
# 設置搜索時顯示通道地址
conda config --set show_channel_urls yes

中科大源:

conda config --add channels https://mirrors.ustc.edu.cn/anaconda/pkgs/main/
conda config --add channels https://mirrors.ustc.edu.cn/anaconda/pkgs/free/
conda config --add channels https://mirrors.ustc.edu.cn/anaconda/cloud/conda-forge/
conda config --add channels https://mirrors.ustc.edu.cn/anaconda/cloud/msys2/
conda config --add channels https://mirrors.ustc.edu.cn/anaconda/cloud/bioconda/
conda config --add channels https://mirrors.ustc.edu.cn/anaconda/cloud/menpo/
conda config --set show_channel_urls yes

輸入這個conda config --show channels看看是否設置成功,如果設置沒成功,那麼自己百度~

設置pip國內源

windows下,創建一個pip目錄,如:C:\Users\當前計算機用戶文件夾\pip,然後新建文件pip.ini,在pip.ini文件中輸入以下內容(以豆瓣鏡像爲例):

[global]
index-url = http://pypi.douban.com/simple
[install]
trusted-host = pypi.douban.com

注:pip文件夾需要我們自己創建

安裝tensorflow2.0

# CPU版本
pip install tensorflow==2.1.0
# GPU版本
pip install tensorflow-gpu==2.1.0

注:GPU版本需要安裝對應的N卡驅動和cuda

應用初始化

Django數據庫初始化:

python manage.py migrate

Pix2Pix Z系統運行:

python manage.py runserver

最後的說明

如果在操作過程中,有什麼問題都可以向我提問。

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章