FMA-Net 部署
项目地址
环境配置
conda create -n fmanet python=3.9
conda activate fmanet
pip install numpy==1.21.2
pip install torch==1.9.1+cu111 torchvision==0.10.1+cu111 torchaudio==0.9.1 -f https://download.pytorch.org/whl/torch_stable.html
pip install opencv-python
pip install einops
pip install scipy==1.10.1
pip install tqdm
数据下载
下载后,解压到 ./dataset/REDS
运行命令
- generate REDS4
cd FMA-Net
python preprocessing/generate_reds4.py
生成后的 REDS4 数据集目录结构
以 train_blur_bicubic 为例
./dataset/REDS4
├── train_blur_bicubic
├──── train
├──────── train_blur_bicubic
├──────────── X4
├─────────────── 000
├────────────────── 0000000.png
├────────────────── 0000001.png
├────────────────── ...
├─────────────── 001
├────────────────── 0010000.png
├────────────────── 0010001.png
├────────────────── ...
├─────────────── ...
- generate FMA-Net flow
python preprocessing/generate_flow.py --model ./pretrained/raft-sintel.pth --mixed_precision
- 训练
-
第一次训练,需要更改配置
- 修改 FMA-Net/experiment.cfg, 将 stage = 2 修改为 stage = 1
-
如果使用预训练模型
- FMA-Net/experiment.cfg, 保持 stage = 2
- 下载预训练模型, 解压,将模型文件放在 ./result/FMA-Net/model_stage2/
python main.py --train --config_path experiment.cfg
- 测试
python main.py --test --config_path experiment.cfg
可能出现的问题
- cuda 无法使用
检查 cuda 版本,和 pytorch 版本是否匹配
- numpy 报错
检查 numpy 版本,是否与项目要求一致
- 数据路径错误
结合代码,检查数据路径是否正确