flownet2 编译及运行

flownet2 编译及运行
https://github.com/lmb-freiburg/flownet2



First compile caffe, by configuring a

"Makefile.config" (example given in Makefile.config.example)  ---删除文件的".example"后缀即可

then make with

$ make -j 5 all tools pycaffe


编译遇到问题:

In file included from src/caffe/solvers/sgd_solver.cpp:5:0:
./include/caffe/util/hdf5.hpp:6:18: fatal error: hdf5.h: No such file or directory
 #include "hdf5.h"
                  ^
compilation terminated.
make: *** [.build_release/src/caffe/solvers/sgd_solver.o] Error 1
make: *** Waiting for unfinished jobs....
In file included from ./include/caffe/caffe.hpp:12:0,
                 from src/caffe/util/output.cpp:7:
./include/caffe/net.hpp: In member function ‘const std::vector*>& caffe::Net::ForwardPrefilled(Dtype*)’:
./include/caffe/net.hpp:41:116: warning: typedef ‘INVALID_REQUESTED_LOG_SEVERITY’ locally defined but not used [-Wunused-local-typedefs]
     LOG_EVERY_N(WARNING, 1000) << "DEPRECATED: ForwardPrefilled() "
                                                                                                                    ^
In file included from ./include/caffe/caffe.hpp:12:0,
                 from src/caffe/parallel.cpp:12:
./include/caffe/net.hpp: In member function ‘const std::vector*>& caffe::Net::ForwardPrefilled(Dtype*)’:
./include/caffe/net.hpp:41:116: warning: typedef ‘INVALID_REQUESTED_LOG_SEVERITY’ locally defined but not used [-Wunused-local-typedefs]
     LOG_EVERY_N(WARNING, 1000) << "DEPRECATED: ForwardPrefilled() "
                                                                                                                    ^

解决办法:
$ sudo apt-get install libhdf5-dev


运行例子:注意,若采用大的模型可能会出现gpu out of memory 问题,因此采用FlowNet2-cs这个较小的模型
python  /home/li/flownet2/scripts/run-flownet.py /home/li/flownet2/models/FlowNet2-cs/FlowNet2-cs_weights.caffemodel  /home/li/flownet2/models/FlowNet2-cs/FlowNet2-cs_deploy.prototxt.template /home/li/flownet2/data/FlyingChairs_examples/0000005-img0.ppm /home/li/flownet2/data/FlyingChairs_examples/0000005-img1.ppm /home/li/flownet2/data/FlyingChairs_examples/z.flo

运行过程遇到问题
WARNING: Logging before InitGoogleLogging() is written to STDERR
F0507 16:19:44.667901 25950 layer_factory.cpp:69] Layer conv1 has unknown engine.

解决办法:
将FlowNet2-cs_deploy.prototxt.template文件内的 engine:CUDNN 全部替换为 engine:CAFFE

运行ok!

flownet2 编译及运行_第1张图片

                                                                05例图结果


flownet2 编译及运行_第2张图片

                                                              04例图结果

.flo文件转换为png格式的方法:

参见 https://blog.csdn.net/qq_20514449/article/details/78907403

下载光流文件转图片格式文件flow-code.
http://download.csdn.net/download/qq_20514449/10174848
按照README.txt文件中的步骤进行编译安装
cd imageLib
make
cd ..
make

到此就编译完成了,此时当前文件夹下会有两个可执行文件,分别为colortest和color_flow。

./color_flow  1.flo 1.png 命令即可实现flo向 png的格式转换


你可能感兴趣的:(flownet2 编译及运行)