EDSR MDSR IRAN RCN -pytorch实现及代码常见问题
代码下载地址:https://github.com/sanghyun-son/EDSR-PyTorch
环境配置
Dependencies
- Python 3.6
- PyTorch >= 1.0.0
- numpy
- skimage
- imageio
- matplotlib
- tqdm
配置代码
基于cuda=10.0安装pytorch 1.1.0
conda create -n edsr python=3.6.9
conda activate edsr
conda install pytorch==1.1.0 torchvision==0.3.0 cudatoolkit=10.0 -c pytorch
pip install matplotlib
pip install skimage
pip install tqdm
ERROR: Could not find a version that satisfies the requirement skimage
ERROR: No matching distribution found for skimage
pip install scikit-image
训练
在下载的文件夹中打开demo.sh有相应的运行命令
如果只需要简单开始训练只需要 Python main.py
需下载相应的训练集,DIV2K:https://cv.snu.ac.kr/research/EDSR/DIV2K.tar
下载后将文件解压到对应文件位置EDSR-PyTorch-master\src\data,然后在option.py中更改数据路径。
训练自己的模型:Python main.py --scale 2 --model IRAN --n_resblocks 32 --n_feats 256 --res_scale 0.1
测试
下载有benchmark的数据集set5 set14 等:https://cv.snu.ac.kr/research/EDSR/benchmark.tar
在data目录下新建文件夹benchmark里面放入各个数据集即可,
配置参数:–scale 4 --pre_train …/experiment/test/model/model_best.pt --test_only --chop --data_test Set5
上面是已经训练过的模型结果model——best.
–scale 2 --pre_train …/experiment/test/model/EDSR_x2.pt --test_only --chop --data_test Set5 --model EDSR --n_resblocks 32 --n_feats 256 --res_scale 0.1
训练自己的模型