论文地址具有上下文注意的生成图像修复
论文代码:GitHub
01配置环境
根据原文代码中read me中要求,进行环境配置以及包的安装。
Run
安装python3。
安装tensorflow(在1.3.0,1.4.0,1.5.0,1.6.0,1.7.0版本上进行了测试)。
安装tensorflow工具包neuralgym(运行pip Install git+https://github.com/JiahuiYu/neuralgym)。
01安装tensorflow
我在pycharm中安装tensorflow发生报错,我选择在conda中安装,Read me中各几个版本的(1.3/4/5/6/7.0)对应的python版本都很低,选择安装py3.6。
第一步:导入下载镜像地址,加速下载。配置国内源
conda config --add channels https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/free/
conda config --add channels https://mirrors.tuna.tsinghua.edu.cn/anaonda/pkgs/main/
第二步:现实源地址
conda config --set show_channel_urls yes
第三步:创建一个3.6的python环境
conda create --prefix=D:\an\anaconda\envs\xf3.6 python=3.6
conda remove -n xf --all
conda create -n txxf3.6 python=3.6
conda activate xf3.6
第四步:安装1.4.0的版本的tensorflow,我安装了1.3.0和1.7.0都报错了,Conv2D可能没有。 第五步:安装gpu版本的tensorflow
conda install tensorflow==1.4.0
pip install tensorflow-gpu==1.4.0 -i https://pypi.tuna.tsinghua.edu.cn/simple pip -U --trusted-host pypi.tuna.tsinghua.edu.cn
02安装neuralgym
我们需要运行代码pip Install git+https://github.com/JiahuiYu/neuralgym,首先我们需要下载一个git。