-
Notifications
You must be signed in to change notification settings - Fork 1.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
OpenCV Error! #65
Comments
``## Refer to http://caffe.berkeleyvision.org/installation.html Contributions simplifying and improving our build system are welcome!cuDNN acceleration switch (uncomment to build with cuDNN).USE_CUDNN := 1 CPU-only switch (uncomment to build without GPU support).CPU_ONLY := 1uncomment to disable IO dependencies and corresponding data layersUSE_OPENCV := 0USE_LEVELDB := 0USE_LMDB := 0uncomment to allow MDB_NOLOCK when reading LMDB files (only if necessary)You should not set this flag if you will be reading LMDBs with anypossibility of simultaneous read and writeALLOW_LMDB_NOLOCK := 1Uncomment if you're using OpenCV 3OPENCV_VERSION := 3To customize your choice of compiler, uncomment and set the following.N.B. the default for Linux is g++ and the default for OSX is clang++CUSTOM_CXX := g++CUDA directory contains bin/ and lib/ directories that we need.CUDA_DIR := /usr/local/cuda On Ubuntu 14.04, if cuda tools are installed via"sudo apt-get install nvidia-cuda-toolkit" then use this instead:CUDA_DIR := /usrCUDA architecture setting: going with all of them.For CUDA < 6.0, comment the *_50 lines for compatibility.CUDA_ARCH := -gencode arch=compute_20,code=sm_20 BLAS choice:atlas for ATLAS (default)mkl for MKLopen for OpenBlasBLAS := mkl Custom (MKL/ATLAS/OpenBLAS) include and lib directories.Leave commented to accept the defaults for your choice of BLAS(which should work)!BLAS_INCLUDE := /path/to/your/blasBLAS_LIB := /path/to/your/blasBLAS_INCLUDE := /opt/intel/composer_xe_2013_sp1.3.174/mkl/include Homebrew puts openblas in a directory that is not on the standard search pathBLAS_INCLUDE := $(shell brew --prefix openblas)/includeBLAS_LIB := $(shell brew --prefix openblas)/libThis is required only if you will compile the matlab interface.MATLAB directory should contain the mex binary in /bin.MATLAB_DIR := /usr/localMATLAB_DIR := /Applications/MATLAB_R2012b.appMATLAB_DIR :=/usr/local/MATLAB/R2014a NOTE: this is required only if you will compile the python interface.We need to be able to find Python.h and numpy/arrayobject.h.PYTHON_INCLUDE := /usr/include/python2.7 Anaconda Python distribution is quite popular. Include path:Verify anaconda location, sometimes it's in root.ANACONDA_HOME := $(HOME)/anacondaPYTHON_INCLUDE := $(ANACONDA_HOME)/include \
Uncomment to use Python 3 (default is Python 2)PYTHON_LIBRARIES := boost_python3 python3.5mPYTHON_INCLUDE := /usr/include/python3.5m \/usr/lib/python3.5/dist-packages/numpy/core/includeWe need to be able to find libpythonX.X.so or .dylib.PYTHON_LIB := /usr/lib PYTHON_LIB := $(ANACONDA_HOME)/libHomebrew installs numpy in a non standard path (keg only)PYTHON_INCLUDE +=
|
我把这几句话注释掉就好了 |
@KeeganRen if you comment these code, the caffe will not be compiled with opencv and lmdb...the minist test would not passed.. |
@AndrewZhao oh no, the minist not passed ...., but if I uncomment these code, it will error on opencv, but it's include & libs are added. |
@KeeganRen because the type of the minist file is lmdb.do you have followed the weiliu89's suggest?if the caffe still has errors, i think you may try to reinstall the opencv |
Ubuntu 14.04.4 LTS
opencv 2.4.12
compile caffe is ok, but when i compile ssd, it will ....
./include/caffe/layers/video_data_layer.hpp:52:3: error: ‘VideoCapture’ in namespace ‘cv’ does not name a type
cv::VideoCapture cap_;
^
src/caffe/layers/video_data_layer.cpp: In destructor ‘virtual caffe::VideoDataLayer::~VideoDataLayer()’:
src/caffe/layers/video_data_layer.cpp:28:7: error: ‘cap_’ was not declared in this scope
if (cap_.isOpened()) {
^
src/caffe/layers/video_data_layer.cpp: In member function ‘virtual void caffe::VideoDataLayer::DataLayerSetUp(const std::vectorcaffe::Blob<Dtype_>&, const std::vectorcaffe::Blob<Dtype_>&)’:
src/caffe/layers/video_data_layer.cpp:45:10: error: ‘cap_’ was not declared in this scope
if (!cap_.open(device_id)) {
^
src/caffe/layers/video_data_layer.cpp:48:5: error: ‘cap_’ was not declared in this scope
cap_ >> cv_img;
^
src/caffe/layers/video_data_layer.cpp:52:10: error: ‘cap_’ was not declared in this scope
if (!cap_.open(video_file)) {
^
src/caffe/layers/video_data_layer.cpp:55:21: error: ‘cap_’ was not declared in this scope
total_frames_ = cap_.get(CV_CAP_PROP_FRAME_COUNT);
^
src/caffe/layers/video_data_layer.cpp:55:30: error: ‘CV_CAP_PROP_FRAME_COUNT’ was not declared in this scope
total_frames_ = cap_.get(CV_CAP_PROP_FRAME_COUNT);
^
src/caffe/layers/video_data_layer.cpp:60:14: error: ‘CV_CAP_PROP_POS_FRAMES’ was not declared in this scope
cap_.set(CV_CAP_PROP_POS_FRAMES, 0);
^
In file included from ./include/caffe/common.hpp:6:0,
from ./include/caffe/blob.hpp:8,
from ./include/caffe/data_transformer.hpp:8,
from src/caffe/layers/video_data_layer.cpp:14:
src/caffe/layers/video_data_layer.cpp:64:15: error: invalid use of incomplete type ‘class cv::Mat’
CHECK(cv_img.data) << "Could not load image!";
^
In file included from ./include/caffe/blob.hpp:8:0,
from ./include/caffe/data_transformer.hpp:8,
from src/caffe/layers/video_data_layer.cpp:14:
./include/caffe/common.hpp:73:22: error: forward declaration of ‘class cv::Mat’
namespace cv { class Mat; }
^
src/caffe/layers/video_data_layer.cpp: In member function ‘virtual void caffe::VideoDataLayer::load_batch(caffe::Batch)’:
src/caffe/layers/video_data_layer.cpp:116:7: error: ‘cap’ was not declared in this scope
cap_ >> cv_img;
^
src/caffe/layers/video_data_layer.cpp:123:7: error: ‘cap_’ was not declared in this scope
cap_ >> cv_img;
^
In file included from ./include/caffe/common.hpp:6:0,
from ./include/caffe/blob.hpp:8,
from ./include/caffe/data_transformer.hpp:8,
from src/caffe/layers/video_data_layer.cpp:14:
src/caffe/layers/video_data_layer.cpp:127:17: error: invalid use of incomplete type ‘class cv::Mat’
CHECK(cv_img.data) << "Could not load image!";
^
In file included from ./include/caffe/blob.hpp:8:0,
from ./include/caffe/data_transformer.hpp:8,
from src/caffe/layers/video_data_layer.cpp:14:
./include/caffe/common.hpp:73:22: error: forward declaration of ‘class cv::Mat’
namespace cv { class Mat; }
^
src/caffe/layers/video_data_layer.cpp: In instantiation of ‘void caffe::VideoDataLayer::DataLayerSetUp(const std::vectorcaffe::Blob<Dtype_>&, const std::vectorcaffe::Blob<Dtype_>&) [with Dtype = float]’:
src/caffe/layers/video_data_layer.cpp:146:1: required from here
src/caffe/layers/video_data_layer.cpp:42:11: error: ‘cv::Mat cv_img’ has incomplete type
cv::Mat cv_img;
^
src/caffe/layers/video_data_layer.cpp: In instantiation of ‘void caffe::VideoDataLayer::load_batch(caffe::Batch) [with Dtype = float]’:
src/caffe/layers/video_data_layer.cpp:146:1: required from here
src/caffe/layers/video_data_layer.cpp:114:13: error: ‘cv::Mat cv_img’ has incomplete type
cv::Mat cv_img;
^
src/caffe/layers/video_data_layer.cpp: In instantiation of ‘void caffe::VideoDataLayer::DataLayerSetUp(const std::vectorcaffe::Blob<Dtype>&, const std::vectorcaffe::Blob<Dtype_>&) [with Dtype = double]’:
src/caffe/layers/video_data_layer.cpp:146:1: required from here
src/caffe/layers/video_data_layer.cpp:42:11: error: ‘cv::Mat cv_img’ has incomplete type
cv::Mat cv_img;
^
src/caffe/layers/video_data_layer.cpp: In instantiation of ‘void caffe::VideoDataLayer::load_batch(caffe::Batch) [with Dtype = double]’:
src/caffe/layers/video_data_layer.cpp:146:1: required from here
src/caffe/layers/video_data_layer.cpp:114:13: error: ‘cv::Mat cv_img’ has incomplete type
cv::Mat cv_img;
^
make: ** [.build_release/src/caffe/layers/video_data_layer.o] Error 1
make: *** Waiting for unfinished jobs....
The text was updated successfully, but these errors were encountered: