其他分享
首页 > 其他分享> > pix2pix pytorch win环境下复现(一)

pix2pix pytorch win环境下复现(一)

作者:互联网

pix2pix pytorch环境下运行


前言

原教程地址
相关环境搭建笔记
相关原理笔记
相关的tensorflow版本运行


一、下载源码

首先,依照官方的教程,用github桌面端将项目clone下来
git clone很慢怎么办?
不要慌!
根据知乎回答,我们只需要将原本的网站中的http://github.com 进行替换为github.com.cnpmjs.org就可以了!亲测有效!

好了 下载下来之后怎么办呢 我们打开python
在命令行中run 如下命令
(注意要以管理员身份运行这些命令 不然没有install权限)

cd C:\Users\用户名\Documents\GitHub\pytorch-CycleGAN-and-pix2pix
 pip install -r requirements.txt

然后等待下载

二、下载数据集

接下来在git bash中运行如下命令以下载数据集

bash ./datasets/download_pix2pix_dataset.sh [cityscapes, night2day, edges2handbags, edges2shoes, facades, maps]

三、下载预训练的模型

法一:官方方法(需要wget) 已失败
运行以下命令以下载预训练的模型

 bash C:/Users/67327/Documents/GitHub/pytorch-CycleGAN-and-pix2pix/scripts/download_pix2pix_model.sh [edges2shoes, sat2map, map2sat, facades_label2photo, and day2night]

此时bash报错说 wget: command not found
应当是没有安装wget软件包
为了在win上安装wget

安装wget

安装chocolatey

cd C:\Users\67327\Documents\download_by_myself
@powershell -NoProfile -ExecutionPolicy Bypass -Command "iex ((New-Object System.Net.WebClient).DownloadString('install.ps1'))" && SET "PATH=%PATH%;%ALLUSERSPROFILE%\chocolatey\bin"

报错:
使用“1”个参数调用“DownloadString”时发生异常:“操作超时”
所在位置 行:1 字符: 60