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

最后的说明

如果在操作过程中,有什么问题都可以向我提问。

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