Method
- Install Ubuntu16.04
- Install NVIDIA Driver and CUDA 10.0
- Install Anaconda python3.7
- Change Anaconda Mirror
- Install Pytorch 1.0.1 with CUDA 10.0
conda install pytorch==1.0.1 torchvision==0.2.2 cudatoolkit=10.0 -c pytorch
- git clone nvidia: flownet2-pytorch
- use conda to install all the necessary package
- install flownet2-pytorch/networks use code
bash install.sh
update install.sh as flows:
#!/bin/bash
cd ./networks/correlation_package
rm -rf *_cuda.egg-info build dist __pycache__
python3 setup.py install
cd ../resample2d_package
rm -rf *_cuda.egg-info build dist __pycache__
python3 setup.py install
cd ../channelnorm_package
rm -rf *_cuda.egg-info build dist __pycache__
python3 setup.py install
cd ..
- replace
from scipy.misc import imread, imresize
tofrom imageio import imread
- replace
async=True
tonon_blocking=True
in main.py - download model and MPISintel and predict
python main.py --inference --model FlowNet2 --save_flow --inference_dataset MpiSintelClean --inference_dataset_root '/home/yqs/data/flownet2-pytorch/dataset/MPI-Sintel/training' --resume '/home/yqs/data/flownet2-pytorch/models/FlowNet2_checkpoint.pth.tar'
- show
import utils
import matplotlib.pyplot as plt
img = flow_utils.readFlow('/home/yqs/data/flownet2-pytorch/work/inference/run.epoch-0-flow-field/000000.flo')
plt.imshow(img[:,:,0])
plt.imshow(img[:,:,1])
CODE
https://github.com/Yannnnnnnnnnnn/flownet2-pytorch