yahoo / CaffeOnSpark

Distributed deep learning on Hadoop and Spark clusters.
Apache License 2.0
1.27k stars 358 forks source link

Error when building [exec] src/main/cpp/jni/JniMat.cpp: In function ‘void Java_com_yahoo_ml_jcaffe_Mat_decode(JNIEnv*, jobject, jint, jlong)’: [exec] src/main/cpp/jni/JniMat.cpp:82:65: error: too many arguments to function ‘cv::Mat cv::imdecode(cv::InputArray, int)’ #245

Open gaohannk opened 7 years ago

gaohannk commented 7 years ago

[WARNING] Using platform encoding (UTF-8 actually) to copy filtered resources, i.e. build is platform dependent! [INFO] skip non existing resourceDirectory /home/labuser/CaffeOnSpark/caffe-distri/src/main/resources [INFO] [INFO] --- maven-compiler-plugin:3.0:compile (default-compile) @ caffe-distri --- [INFO] Changes detected - recompiling the module! [WARNING] File encoding has not been set, using platform encoding UTF-8, i.e. build is platform dependent! [INFO] Compiling 10 source files to /home/labuser/CaffeOnSpark/caffe-distri/target/classes [INFO] [INFO] --- maven-antrun-plugin:1.7:run (make) @ caffe-distri --- [INFO] Executing tasks

make: [exec] make[1]: Entering directory `/home/labuser/CaffeOnSpark/caffe-distri' [exec] javah -d include/jni -force -cp target/classes \ [exec] com.yahoo.ml.jcaffe.MatVector [exec] javah -d include/jni -force -cp target/classes \ [exec] com.yahoo.ml.jcaffe.Mat [exec] javah -d include/jni -force -cp target/classes \ [exec] com.yahoo.ml.jcaffe.FloatBlob [exec] javah -d include/jni -force -cp target/classes \ [exec] com.yahoo.ml.jcaffe.FloatDataTransformer [exec] javah -d include/jni -force -cp target/classes \ [exec] com.yahoo.ml.jcaffe.FloatArray [exec] javah -d include/jni -force -cp target/classes \ [exec] com.yahoo.ml.jcaffe.CaffeNet [exec] CXX src/main/cpp/jni/JniMatVector.cpp [exec] CXX src/main/cpp/jni/JniMat.cpp [exec] make[1]: ** [.build_release/src/main/cpp/jni/JniMat.o] Error 1 [exec] src/main/cpp/jni/JniMat.cpp: In function ‘void Java_com_yahoo_ml_jcaffe_Mat_decode(JNIEnv, jobject, jint, jlong)’: [exec] src/main/cpp/jni/JniMat.cpp:82:65: error: too many arguments to function ‘cv::Mat cv::imdecode(cv::InputArray, int)’ [exec] /usr/include/opencv2/highgui/highgui.hpp:136:18: note: declared here

[INFO] ------------------------------------------------------------------------ [INFO] Reactor Summary: [INFO] [INFO] caffe .............................................. SUCCESS [ 0.002 s] [INFO] caffe-distri ....................................... FAILURE [ 17.266 s] [INFO] caffe-grid ......................................... SKIPPED [INFO] ------------------------------------------------------------------------ [INFO] BUILD FAILURE [INFO] ------------------------------------------------------------------------ [INFO] Total time: 17.547 s [INFO] Finished at: 2017-04-09T19:57:00-04:00 [INFO] Final Memory: 21M/455M [INFO] ------------------------------------------------------------------------ [ERROR] Failed to execute goal org.apache.maven.plugins:maven-antrun-plugin:1.7:run (make) on project caffe-distri: An Ant BuildException has occured: exec returned: 2 [ERROR] around Ant part ...... @ 5:92 in /home/labuser/CaffeOnSpark/caffe-distri/target/antrun/build-make.xml [ERROR] -> [Help 1] [ERROR] [ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch. [ERROR] Re-run Maven using the -X switch to enable full debug logging. [ERROR] [ERROR] For more information about the errors and possible solutions, please read the following articles: [ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoExecutionException [ERROR] [ERROR] After correcting the problems, you can resume the build with the command [ERROR] mvn -rf :caffe-distri make: *** [build] Error 1

I got this error when building, i didn't find solution for this.

junshi15 commented 7 years ago

Your openCV version may not be compatible. We use openCV2.4, which is not compatible with 3.x.

gaohannk commented 7 years ago

Thanks, feedback. Actually, I install opencv3.x solve the problem. The previous one is openCV2.x install by using apt-get under ubuntu 12.04.