msracver / Deep-Feature-Flow

Deep Feature Flow for Video Recognition
MIT License
1.3k stars 297 forks source link

install problem about cv::imencode #6

Closed Lucien7786 closed 7 years ago

Lucien7786 commented 7 years ago

when I followed the Installation steps, I came across the opencv version problem here.

  1. The official latest mxnet can be installed and run under python.

lucien@lucien-System-Product-Name:~$ python Python 2.7.6 (default, Oct 26 2016, 20:30:19) [GCC 4.8.4] on linux2 Type "help", "copyright", "credits" or "license" for more information.

import mxnet as mx a = mx.nd.ones((2,3),mx.gpu()) b = a * 2 + 1 b.asnumpy() array([[ 3., 3., 3.], [ 3., 3., 3.]], dtype=float32) exit() lucien@lucien-System-Product-Name:~$ which python /usr/bin/python import mxnet print mxnet.path ['/usr/local/lib/python2.7/dist-packages/mxnet'] print mxnet.version 0.9.5-1

but when run ./rfcn/demo.py, error occurred.

Traceback (most recent call last): File "./rfcn/demo.py", line 142, in main() File "./rfcn/demo.py", line 49, in main sym = sym_instance.get_test_symbol(config) File "/home/lucien/Deep-Feature-Flow/rfcn/symbols/resnet_v1_101_rfcn.py", line 627, in get_test_symbol rois = mx.contrib.sym.MultiProposal( AttributeError: 'module' object has no attribute 'MultiProposal'

  1. I went back to download the MXNet@(commit 62ecb60) and Copy operators in ./rfcn/operator_cxx to $(YOUR_MXNET_FOLDER)/src/operator/contrib and recompile MXNet.

/tmp/ccSXCcI0.o:在函数‘main’中: im2rec.cc:(.text.startup+0x2e90):对‘cv::imencode(std::__cxx11::basic_string<char, std::char_traits, std::allocator > const&, cv::_InputArray const&, std::vector<unsigned char, std::allocator >&, std::vector<int, std::allocator > const&)’未定义的引用 collect2: 错误:ld 返回 1 make: *** [bin/im2rec] 错误 1

so, I found it maybe opencv version problems.

lucien@lucien-System-Product-Name:~/Deep-Feature-Flow$ pkg-config --libs opencv /usr/local/lib/libopencv_calib3d.so /usr/local/lib/libopencv_contrib.so /usr/local/lib/libopencv_core.so /usr/local/lib/libopencv_features2d.so /usr/local/lib/libopencv_flann.so /usr/local/lib/libopencv_gpu.so /usr/local/lib/libopencv_highgui.so /usr/local/lib/libopencv_imgproc.so /usr/local/lib/libopencv_legacy.so /usr/local/lib/libopencv_ml.so /usr/local/lib/libopencv_nonfree.so /usr/local/lib/libopencv_objdetect.so /usr/local/lib/libopencv_ocl.so /usr/local/lib/libopencv_photo.so /usr/local/lib/libopencv_stitching.so /usr/local/lib/libopencv_superres.so /usr/local/lib/libopencv_ts.a /usr/local/lib/libopencv_video.so /usr/local/lib/libopencv_videostab.so /usr/lib/x86_64-linux-gnu/libXext.so /usr/lib/x86_64-linux-gnu/libX11.so /usr/lib/x86_64-linux-gnu/libICE.so /usr/lib/x86_64-linux-gnu/libSM.so /usr/lib/x86_64-linux-gnu/libGL.so /usr/lib/x86_64-linux-gnu/libGLU.so -L/usr/local/cuda/lib64 -L/usr/local/lib -lcufft -lcublas -lnpps -lnppi -lnppc -lcudart -ltbb -lrt -lpthread -lm -ldl -lopencv_calib3d -lopencv_contrib -lopencv_core -lopencv_features2d -lopencv_flann -lopencv_gpu -lopencv_highgui -lopencv_imgproc -lopencv_legacy -lopencv_ml -lopencv_nonfree -lopencv_objdetect -lopencv_ocl -lopencv_photo -lopencv_stitching -lopencv_superres -lopencv_ts -lopencv_video -lopencv_videostab lucien@lucien-System-Product-Name:~/Deep-Feature-Flow$ pkg-config --modversion opencv 2.4.10 lucien@lucien-System-Product-Name:~/Deep-Feature-Flow$ pip install opencv-python==3.2.0.6 Requirement already satisfied: opencv-python==3.2.0.6 in /usr/local/lib/python2.7/dist-packages Requirement already satisfied: numpy>=1.11.3 in /usr/local/lib/python2.7/dist-packages (from opencv-python==3.2.0.6)

There is no module named 'libopencv_imgcodecs' under opencv 2.4.10. And opencv-python==3.2.0.6 has installed under python.

can I use the opencv-python 3.2.0.6 to recompile MXNet@(commit 62ecb60)? Or I had to install opencv 3.2 version under '/usr/local/lib/', too? as the same as opencv 2.4.10? I am confused. Waiting for your reply and suggestion. p.s. such 'make clean & make' is useless answer, I had tried several times and did not work!!!

Ubuntu 14.04, Cuda 8 with cudnn 5.1, Python 2.7.6, GCC 4.8.4, single Titan X pascal card.

YuwenXiong commented 7 years ago

A simple but bruteforce solution might work: recompile MXNet with opencv=0 in config.mk (it will disable imrecord function, which disable MXNet from doing image classification task, but won't affect Deep Feature Flow).

Lucien7786 commented 7 years ago

It works. Thank you for your reply. @Orpine Infact, before close opencv in config.mk. The 'libmxnet.a' and 'libmxnet.so' has been compiled completely under 'lib' sub folder.