FMA-Net 部署

FMA-Net 部署

项目地址

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

数据下载

REDS

下载后,解压到 ./dataset/REDS

运行命令

  1. 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
├────────────────── ...
├─────────────── ...
  1. generate FMA-Net flow
python preprocessing/generate_flow.py --model ./pretrained/raft-sintel.pth --mixed_precision
  1. 训练
  • 第一次训练,需要更改配置

    • 修改 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
  1. 测试
python main.py --test --config_path experiment.cfg

可能出现的问题

  • cuda 无法使用

检查 cuda 版本,和 pytorch 版本是否匹配

  • numpy 报错

检查 numpy 版本,是否与项目要求一致

  • 数据路径错误

结合代码,检查数据路径是否正确

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值