或许有冗余步骤、之后再优化。
1.桌面右键-git bash-输入命令如下【git clone https://github.com/junyanz/pytorch-CycleGAN-and-pix2pix】
2.打开anaconda的prompt,cd到pytorch-CycleGAN-and-pix2pix路径
3.在prompt里输入【conda env create -f environment.yml】配置虚拟环境及相应的包
4.在prompt里输入【conda activate pytorch-CycleGAN-and-pix2pix】激活虚拟环境
5.下载数据集。在github中说:
bash是linux命令,在win中,直接打开刚才下载的pytorch-CycleGAN-and-pix2pix文件夹找到datasets然后找到download_pix2pix_dataset.sh文件,记事本打开,找到url
打开http://efrosgans.eecs.berkeley.edu/pix2pix/datasets/
找到facades数据集下载
解压到pytorch-CycleGAN-and-pix2pix文件夹的datasets文件夹下
6.回到刚才的prompt,输入【pip install visdom】然后输入【python -m visdom.server
】以便后续可视化运行结果
- To view training results and loss plots, run
python -m visdom.server
and click the URL http://localhost:8097.
7.打开pycharm,左上角open,找到下载的pytorch-CycleGAN-and-pix2pix,然后open
8.右下角interpreter设置,调成虚拟环境:
9.点开pycharm左下角terminal,输入【python test.py --dataroot ./datasets/facades --name facades_pix2pix --model pix2pix --direction BtoA】
即可跑代码