本博客是基于NVIDIA 开源代码 https://github.com/NVIDIA/flownet2-pytorch 而来
- 代码支持多GPU运行
- 例子数据集 MPI-Sintel 下载地址: http://sintel.is.tue.mpg.de/
- 所提供的的网络结构 model:
- FlowNet2S
- FlowNet2C
- FlowNet2CS
- FlowNet2CSS
- FlowNet2SD
- FlowNet2
- FlowNet2 和 FlowNet2C 是基于自定义层 Resample2d 或者 Correlation
- Resample2d 和 Correlation 都在NVIDIA提供的代码中 需要先编译才能使用
- 损失函数
- 损失函数提供了三种: L1, L2 和 multi-scale
运行代码:
# get flownet2-pytorch source
git clone https://github.com/NVIDIA/flownet2-pytorch.git
cd flownet2-pytorch
# install custom layers
bash install.sh
在运行 bash install.sh 的 时候可能会因为pytorch 的版本问题而报错,可以尝试通过降低pytorch版本来解决相关问题,该代码在pytorch 0.4.1 版本上运行会报错误,建议降低至 0.4.0 版本,可以通过以下命令修改版本.
pip install torch==0.4.0 (--user 使用服务器的同学加这项参数)
修改版本后,运行 bash install.sh 可能会报 找不到各种package或者 module 的错误,缺少什么 就 pip install 什么
预训练模型下载
- FlowNet2S [620M]
- FlowNet2C[149M]
- FlowNet2CS [297M]
- FlowNet2CSS [445]