Closed Light-- closed 4 years ago
In building TSN:
The problem may caused by different versions opencv exist in the OS conflict. Maybe they haven't been installed properly. e.g. install to the right path.
This is a contradiction: The build_all.sh
install opencv 2.4.13.6, opencv 2.4.13.6 don't have opencv_contrib, so it surely will not have xfeatures2d. But dense_flow/src/dense_warp_flow_gpu.cpp
needs xfeatures2d for compiling, so actually i have to modify the build_all.sh
to install opencv3.x, not 2.x and changed the api format from 2.x to 3.x in dense_flow.cpp
, accordingly
i solved it by: First: uninstall all the versions of opencv in the environment, until only the version that the Ubuntu16.04 OS built-in: opencv 2.4.9.1 left.
$ cd build # build is the original folder that you build to install opencv, if you lost that, try to rebuild to install opencv using CMAKE_INSTALL_PREFIX to specify the install path according to the install path you used before.
$ sudo make uninstall
$ cd ..
$ sudo rm -r build
$ sudo rm -r /usr/local/include/opencv2 /usr/local/include/opencv /usr/include/opencv /usr/include/opencv2 /usr/local/share/opencv /usr/local/share/OpenCV /usr/share/opencv /usr/share/OpenCV /usr/local/bin/opencv* /usr/local/lib/libopencv*
$ cd ..
$ sudo rm -r opencv4.0/ # delete the original folder completely after you saved the necessary files(like manually changed cmake files and so on.)
$ sudo apt-get remove opencv-doc opencv-data python-opencv
Then i install build and install Opencv3.4.2 according to yjxiong's README, passed.
before this successful compile, I changed the build_all.sh
and dense_flow.cpp
a little bit. like
in build_all.sh
# version="2.4.13.6"
version="3.4.2"
in temporal-segment-networks/lib/dense_flow/src/dense_flow.cpp
// cv::Ptr<cv::optflow::DualTVL1OpticalFlow> alg_tvl1 = cv::optflow::DualTVL1OpticalFlow::create();
// alg_tvl1 = cv::optflow::createOptFlow_DualTVL1();
Ptr<DenseOpticalFlow> alg_tvl1;
alg_tvl1 = createOptFlow_DualTVL1();
I‘d like to know whether there are other places that also have to be rewritten?(Couse you said "like" and you show your two changes.)Thanks a lot!
I‘d like to know whether there are other places that also have to be rewritten?(Couse you said "like" and you show your two changes.)Thanks a lot!
Almost the changes I mentioned above are all the ones i have made, at least they are the ones I can remember. If you run into the same problem as me, you can try it.
also mentioned in https://github.com/yjxiong/temporal-segment-networks/issues/122#issuecomment-561099235
i build on ubuntu16.04, cuda10, opencv2.4.13.6