Baidu Warp CTC with Mxnet - wanghaisheng/awesome-ocr GitHub Wiki
The minimal building requirement is
A recent c++ compiler supporting C++ 11 such as g++ >= 4.8 or clang
A BLAS library, such as libblas, libblas, openblas intel mkl
[wanghs@db2 mxnet-ctc]$ g++ -v 使用内建 specs。 COLLECT_GCC=g++ COLLECT_LTO_WRAPPER=/usr/libexec/gcc/x86_64-redhat-linux/4.8.5/lto-wrapper 目标:x86_64-redhat-linux 配置为:../configure --prefix=/usr --mandir=/usr/share/man --infodir=/usr/share/info --with-bugurl=http://bugzilla.redhat.com/bugzilla --enable-bootstrap --enable-shared --enable-threads=posix --enable-checking=release --with-system-zlib --enable-__cxa_atexit --disable-libunwind-exceptions --enable-gnu-unique-object --enable-linker-build-id --with-linker-hash-style=gnu --enable-languages=c,c++,objc,obj-c++,java,fortran,ada,go,lto --enable-plugin --enable-initfini-array --disable-libgcj --with-isl=/builddir/build/BUILD/gcc-4.8.5-20150702/obj-x86_64-redhat-linux/isl-install --with-cloog=/builddir/build/BUILD/gcc-4.8.5-20150702/obj-x86_64-redhat-linux/cloog-install --enable-gnu-indirect-function --with-tune=generic --with-arch_32=x86-64 --build=x86_64-redhat-linux 线程模型:posix gcc 版本 4.8.5 20150623 (Red Hat 4.8.5-4) (GCC)
## install openBLAS
[wanghs@db2 ~]$ git clone https://github.com/xianyi/OpenBLAS
make
make install PREFIX=/opt/OpenBLAS
[wanghs@db2 build]$ cmake -DBUILD_SHARED_LIBS=OFF -DENABLE_PRECOMPILED_HEADERS=OFF ..
-- Detected version of GNU GCC: 48 (408)
-- Found ZLIB: /lib64/libz.so (found suitable version "1.2.7", minimum required is "1.2.3")
-- Could NOT find TIFF (missing: TIFF_LIBRARY TIFF_INCLUDE_DIR)
-- Could NOT find Jasper (missing: JASPER_LIBRARIES JASPER_INCLUDE_DIR)
-- Found ZLIB: /lib64/libz.so (found version "1.2.7")
-- checking for module 'gstreamer-base-1.0'
-- package 'gstreamer-base-1.0' not found
-- checking for module 'gstreamer-video-1.0'
-- package 'gstreamer-video-1.0' not found
-- checking for module 'gstreamer-app-1.0'
-- package 'gstreamer-app-1.0' not found
-- checking for module 'gstreamer-riff-1.0'
-- package 'gstreamer-riff-1.0' not found
-- checking for module 'gstreamer-pbutils-1.0'
-- package 'gstreamer-pbutils-1.0' not found
-- checking for module 'gstreamer-base-0.10'
-- package 'gstreamer-base-0.10' not found
-- checking for module 'gstreamer-video-0.10'
-- package 'gstreamer-video-0.10' not found
-- checking for module 'gstreamer-app-0.10'
-- package 'gstreamer-app-0.10' not found
-- checking for module 'gstreamer-riff-0.10'
-- package 'gstreamer-riff-0.10' not found
-- checking for module 'gstreamer-pbutils-0.10'
-- package 'gstreamer-pbutils-0.10' not found
-- checking for module 'libdc1394-2'
-- package 'libdc1394-2' not found
-- checking for module 'libdc1394'
-- package 'libdc1394' not found
-- checking for module 'libv4l1'
-- package 'libv4l1' not found
-- checking for module 'libv4l2'
-- package 'libv4l2' not found
-- Looking for linux/videodev.h
-- Looking for linux/videodev.h - not found
-- Looking for linux/videodev2.h
-- Looking for linux/videodev2.h - found
-- Looking for sys/videoio.h
-- Looking for sys/videoio.h - not found
-- checking for module 'libavcodec'
-- package 'libavcodec' not found
-- checking for module 'libavformat'
-- package 'libavformat' not found
-- checking for module 'libavutil'
-- package 'libavutil' not found
-- checking for module 'libswscale'
-- package 'libswscale' not found
-- checking for module 'libavresample'
-- package 'libavresample' not found
-- Looking for libavformat/avformat.h
-- Looking for libavformat/avformat.h - not found
-- Looking for ffmpeg/avformat.h
-- Looking for ffmpeg/avformat.h - not found
-- checking for module 'libgphoto2'
-- package 'libgphoto2' not found
-- found IPP (ICV version): 9.0.1 [9.0.1]
-- at: /home/wanghs/opencv-3.1.0/3rdparty/ippicv/unpack/ippicv_lnx
-- To enable PlantUML support, set PLANTUML_JAR environment variable or pass -DPLANTUML_JAR=<filepath> option to cmake
-- Could NOT find PythonInterp: Found unsuitable version "1.4", but required is at least "3.4" (found /home/wanghs/.pyenv/shims/python3.4)
-- Could NOT find PythonInterp: Found unsuitable version "1.4", but required is at least "3.2" (found /home/wanghs/.pyenv/shims/python3.4)
-- Found apache ant 1.9.2: /bin/ant
-- Could NOT find Matlab (missing: MATLAB_MEX_SCRIPT MATLAB_INCLUDE_DIRS MATLAB_ROOT_DIR MATLAB_LIBRARIES MATLAB_LIBRARY_DIRS MATLAB_MEXEXT MATLAB_ARCH MATLAB_BIN)
-- VTK is not found. Please set -DVTK_DIR in CMake to VTK build directory, or to VTK install subdirectory with VTKConfig.cmake file
--
-- General configuration for OpenCV 3.1.0 =====================================
-- Version control: unknown
--
-- Platform:
-- Host: Linux 3.10.0-327.13.1.el7.x86_64 x86_64
-- CMake: 2.8.11
-- CMake generator: Unix Makefiles
-- CMake build tool: /usr/bin/gmake
-- Configuration: Release
--
-- C/C++:
-- Built as dynamic libs?: NO
-- C++ Compiler: /usr/bin/c++ (ver 4.8.5)
-- C++ flags (Release): -fPIC -fsigned-char -W -Wall -Werror=return-type -Werror=non-virtual-dtor -Werror=address -Werror=sequence-point -Wformat -Werror=format-security -Wmissing-declarations -Wundef -Winit-self -Wpointer-arith -Wshadow -Wsign-promo -Wno-narrowing -Wno-delete-non-virtual-dtor -Wno-unnamed-type-template-args -fdiagnostics-show-option -Wno-long-long -pthread -fomit-frame-pointer -msse -msse2 -mno-avx -msse3 -mno-ssse3 -mno-sse4.1 -mno-sse4.2 -ffunction-sections -fvisibility=hidden -fvisibility-inlines-hidden -O3 -DNDEBUG -DNDEBUG
-- C++ flags (Debug): -fPIC -fsigned-char -W -Wall -Werror=return-type -Werror=non-virtual-dtor -Werror=address -Werror=sequence-point -Wformat -Werror=format-security -Wmissing-declarations -Wundef -Winit-self -Wpointer-arith -Wshadow -Wsign-promo -Wno-narrowing -Wno-delete-non-virtual-dtor -Wno-unnamed-type-template-args -fdiagnostics-show-option -Wno-long-long -pthread -fomit-frame-pointer -msse -msse2 -mno-avx -msse3 -mno-ssse3 -mno-sse4.1 -mno-sse4.2 -ffunction-sections -fvisibility=hidden -fvisibility-inlines-hidden -g -O0 -DDEBUG -D_DEBUG
-- C Compiler: /usr/bin/cc
-- C flags (Release): -fPIC -fsigned-char -W -Wall -Werror=return-type -Werror=non-virtual-dtor -Werror=address -Werror=sequence-point -Wformat -Werror=format-security -Wmissing-declarations -Wmissing-prototypes -Wstrict-prototypes -Wundef -Winit-self -Wpointer-arith -Wshadow -Wno-narrowing -Wno-unnamed-type-template-args -fdiagnostics-show-option -Wno-long-long -pthread -fomit-frame-pointer -msse -msse2 -mno-avx -msse3 -mno-ssse3 -mno-sse4.1 -mno-sse4.2 -ffunction-sections -fvisibility=hidden -O3 -DNDEBUG -DNDEBUG
-- C flags (Debug): -fPIC -fsigned-char -W -Wall -Werror=return-type -Werror=non-virtual-dtor -Werror=address -Werror=sequence-point -Wformat -Werror=format-security -Wmissing-declarations -Wmissing-prototypes -Wstrict-prototypes -Wundef -Winit-self -Wpointer-arith -Wshadow -Wno-narrowing -Wno-unnamed-type-template-args -fdiagnostics-show-option -Wno-long-long -pthread -fomit-frame-pointer -msse -msse2 -mno-avx -msse3 -mno-ssse3 -mno-sse4.1 -mno-sse4.2 -ffunction-sections -fvisibility=hidden -g -O0 -DDEBUG -D_DEBUG
-- Linker flags (Release):
-- Linker flags (Debug):
-- Precompiled headers: NO
-- Extra dependencies: stdc++ dl m pthread rt
-- 3rdparty dependencies: ippicv
--
-- OpenCV modules:
-- To be built: core flann imgproc ml photo video imgcodecs shape videoio highgui objdetect superres ts features2d calib3d java stitching videostab python2
-- Disabled: world
-- Disabled by dependency: -
-- Unavailable: cudaarithm cudabgsegm cudacodec cudafeatures2d cudafilters cudaimgproc cudalegacy cudaobjdetect cudaoptflow cudastereo cudawarping cudev python3 viz
--
-- GUI:
-- QT: NO
-- GTK+ 3.x: YES (ver 3.14.13)
-- GThread : YES (ver 2.42.2)
-- GtkGlExt: NO
-- OpenGL support: NO
-- VTK support: NO
--
-- Media I/O:
-- ZLib: /lib64/libz.so (ver 1.2.7)
-- JPEG: /lib64/libjpeg.so (ver )
-- WEBP: build (ver 0.3.1)
-- PNG: /lib64/libpng.so (ver 1.5.13)
-- TIFF: build (ver 42 - 4.0.2)
-- JPEG 2000: build (ver 1.900.1)
-- OpenEXR: build (ver 1.7.1)
-- GDAL: NO
--
-- Video I/O:
-- DC1394 1.x: NO
-- DC1394 2.x: NO
-- FFMPEG: NO
-- codec: NO
-- format: NO
-- util: NO
-- swscale: NO
-- resample: NO
-- gentoo-style: NO
-- GStreamer: NO
-- OpenNI: NO
-- OpenNI PrimeSensor Modules: NO
-- OpenNI2: NO
-- PvAPI: NO
-- GigEVisionSDK: NO
-- UniCap: NO
-- UniCap ucil: NO
-- V4L/V4L2: NO/YES
-- XIMEA: NO
-- Xine: NO
-- gPhoto2: NO
--
-- Parallel framework: pthreads
--
-- Other third-party libraries:
-- Use IPP: 9.0.1 [9.0.1]
-- at: /home/wanghs/opencv-3.1.0/3rdparty/ippicv/unpack/ippicv_lnx
-- Use IPP Async: NO
-- Use VA: NO
-- Use Intel VA-API/OpenCL: NO
-- Use Eigen: YES (ver 3.2.92)
-- Use Cuda: NO
-- Use OpenCL: YES
-- Use custom HAL: NO
--
-- OpenCL:
-- Version: dynamic
-- Include path: /home/wanghs/opencv-3.1.0/3rdparty/include/opencl/1.2
-- Use AMDFFT: NO
-- Use AMDBLAS: NO
--
-- Python 2:
-- Interpreter: /usr/bin/python2.7 (ver 2.7.5)
-- Libraries: /lib64/libpython2.7.so (ver 2.7.5)
-- numpy: /usr/lib64/python2.7/site-packages/numpy/core/include (ver 1.7.1)
-- packages path: lib/python2.7/site-packages
--
-- Python 3:
-- Interpreter: NO
--
-- Python (for build): /usr/bin/python2.7
--
-- Java:
-- ant: /bin/ant (ver 1.9.2)
-- JNI: /usr/java/jdk1.8.0_51/include /usr/java/jdk1.8.0_51/include/linux /usr/java/jdk1.8.0_51/include
-- Java wrappers: YES
-- Java tests: YES
--
-- Matlab: Matlab not found or implicitly disabled
--
-- Documentation:
-- Doxygen: /usr/bin/doxygen (ver 1.8.5)
-- PlantUML: NO
--
-- Tests and samples:
-- Tests: YES
-- Performance tests: YES
-- C/C++ Examples: NO
--
-- Install path: /usr/local
--
-- cvconfig.h is in: /home/wanghs/opencv-3.1.0/build
-- -----------------------------------------------------------------
--
-- Configuring done
-- Generating done
-- Build files have been written to: /home/wanghs/opencv-3.1.0/build
[wanghs@db2 build]$ make
[ 5%] Built target libtiff
[ 10%] Built target libwebp
[ 12%] Built target libjasper
[ 20%] Built target IlmImf
[ 25%] Built target opencv_core
[ 30%] Built target opencv_imgproc
[ 32%] Built target opencv_imgcodecs
[ 32%] Built target opencv_videoio
[ 32%] Built target opencv_highgui
[ 33%] Built target opencv_ts
[ 35%] Built target opencv_perf_core
[ 39%] Built target opencv_test_core
[ 41%] Built target opencv_flann
[ 41%] Built target opencv_test_flann
[ 44%] Built target opencv_perf_imgproc
[ 50%] Built target opencv_test_imgproc
[ 51%] Built target opencv_ml
[ 51%] Built target opencv_test_ml
[ 52%] Built target opencv_photo
[ 53%] Built target opencv_perf_photo
[ 55%] Built target opencv_test_photo
[ 56%] Built target opencv_video
[ 57%] Built target opencv_perf_video
[ 58%] Built target opencv_test_video
[ 58%] Built target opencv_perf_imgcodecs
[ 58%] Built target opencv_test_imgcodecs
[ 58%] Built target opencv_shape
[ 58%] Built target opencv_test_shape
[ 58%] Built target opencv_perf_videoio
[ 60%] Built target opencv_test_videoio
[ 60%] Built target opencv_test_highgui
[ 61%] Built target opencv_objdetect
[ 61%] Built target opencv_perf_objdetect
[ 61%] Built target opencv_test_objdetect
[ 62%] Built target opencv_superres
[ 62%] Built target opencv_perf_superres
[ 62%] Built target opencv_test_superres
[ 65%] Built target opencv_features2d
[ 66%] Built target opencv_perf_features2d
[ 67%] Built target opencv_test_features2d
[ 70%] Built target opencv_calib3d
[ 70%] Built target opencv_perf_calib3d
[ 73%] Built target opencv_test_calib3d
[ 74%] Built target opencv_videostab
[ 75%] Built target opencv_stitching
[ 75%] Generating src/org/opencv/core/Algorithm.java
[ 75%] Generating src/org/opencv/core/Core.java
[ 75%] Generating src/org/opencv/imgproc/Imgproc.java
[ 75%] Generating src/org/opencv/imgproc/CLAHE.java
[ 75%] Generating src/org/opencv/imgproc/Subdiv2D.java
[ 76%] Generating src/org/opencv/imgproc/LineSegmentDetector.java
[ 76%] Generating src/org/opencv/ml/Boost.java
[ 76%] Generating src/org/opencv/ml/SVM.java
[ 76%] Generating src/org/opencv/ml/LogisticRegression.java
[ 76%] Generating src/org/opencv/ml/TrainData.java
[ 76%] Generating src/org/opencv/ml/ANN_MLP.java
[ 76%] Generating src/org/opencv/ml/Ml.java
[ 76%] Generating src/org/opencv/ml/NormalBayesClassifier.java
[ 76%] Generating src/org/opencv/ml/EM.java
[ 76%] Generating src/org/opencv/ml/StatModel.java
[ 76%] Generating src/org/opencv/ml/DTrees.java
[ 76%] Generating src/org/opencv/ml/KNearest.java
[ 76%] Generating src/org/opencv/ml/RTrees.java
[ 78%] Generating src/org/opencv/photo/Tonemap.java
[ 78%] Generating src/org/opencv/photo/MergeMertens.java
[ 78%] Generating src/org/opencv/photo/CalibrateRobertson.java
[ 78%] Generating src/org/opencv/photo/AlignExposures.java
[ 78%] Generating src/org/opencv/photo/CalibrateDebevec.java
[ 78%] Generating src/org/opencv/photo/MergeRobertson.java
[ 78%] Generating src/org/opencv/photo/CalibrateCRF.java
[ 78%] Generating src/org/opencv/photo/TonemapDrago.java
[ 78%] Generating src/org/opencv/photo/MergeExposures.java
[ 78%] Generating src/org/opencv/photo/TonemapDurand.java
[ 78%] Generating src/org/opencv/photo/AlignMTB.java
[ 78%] Generating src/org/opencv/photo/MergeDebevec.java
[ 79%] Generating src/org/opencv/photo/TonemapMantiuk.java
[ 79%] Generating src/org/opencv/photo/TonemapReinhard.java
[ 79%] Generating src/org/opencv/photo/Photo.java
[ 79%] Generating src/org/opencv/video/DenseOpticalFlow.java
[ 79%] Generating src/org/opencv/video/Video.java
[ 79%] Generating src/org/opencv/video/BackgroundSubtractorMOG2.java
[ 79%] Generating src/org/opencv/video/BackgroundSubtractorKNN.java
[ 79%] Generating src/org/opencv/video/DualTVL1OpticalFlow.java
[ 79%] Generating src/org/opencv/video/BackgroundSubtractor.java
[ 79%] Generating src/org/opencv/video/KalmanFilter.java
[ 79%] Generating src/org/opencv/imgcodecs/Imgcodecs.java
[ 79%] Generating src/org/opencv/videoio/Videoio.java
[ 79%] Generating src/org/opencv/videoio/VideoCapture.java
[ 80%] Generating src/org/opencv/videoio/VideoWriter.java
[ 80%] Generating src/org/opencv/objdetect/BaseCascadeClassifier.java
[ 80%] Generating src/org/opencv/objdetect/HOGDescriptor.java
[ 80%] Generating src/org/opencv/objdetect/Objdetect.java
[ 80%] Generating src/org/opencv/objdetect/CascadeClassifier.java
[ 80%] Generating src/org/opencv/features2d/FeatureDetector.java
[ 80%] Generating src/org/opencv/features2d/Features2d.java
[ 80%] Generating src/org/opencv/features2d/DescriptorExtractor.java
[ 80%] Generating src/org/opencv/features2d/DescriptorMatcher.java
[ 80%] Generating src/org/opencv/calib3d/Calib3d.java
[ 80%] Generating src/org/opencv/calib3d/StereoSGBM.java
[ 80%] Generating src/org/opencv/calib3d/StereoBM.java
[ 82%] Generating src/org/opencv/calib3d/StereoMatcher.java
[ 82%] Generating src/org/opencv/utils/Converters.java
[ 82%] Generating src/org/opencv/core/MatOfFloat.java
[ 82%] Generating src/org/opencv/core/MatOfKeyPoint.java
[ 82%] Generating src/org/opencv/core/Scalar.java
[ 82%] Generating src/org/opencv/core/RotatedRect.java
[ 82%] Generating src/org/opencv/core/MatOfDMatch.java
[ 82%] Generating src/org/opencv/core/DMatch.java
[ 82%] Generating src/org/opencv/core/MatOfRect.java
[ 82%] Generating src/org/opencv/core/Mat.java
[ 82%] Generating src/org/opencv/core/Rect.java
[ 82%] Generating src/org/opencv/core/MatOfFloat6.java
[ 82%] Generating src/org/opencv/core/MatOfInt.java
[ 83%] Generating src/org/opencv/core/CvException.java
[ 83%] Generating src/org/opencv/core/MatOfPoint2f.java
[ 83%] Generating src/org/opencv/core/MatOfPoint.java
[ 83%] Generating src/org/opencv/core/MatOfDouble.java
[ 83%] Generating src/org/opencv/core/Point3.java
[ 83%] Generating src/org/opencv/core/MatOfFloat4.java
[ 83%] Generating src/org/opencv/core/MatOfPoint3.java
[ 83%] Generating src/org/opencv/core/Size.java
[ 83%] Generating src/org/opencv/core/Point.java
[ 83%] Generating src/org/opencv/core/MatOfByte.java
[ 83%] Generating src/org/opencv/core/CvType.java
[ 83%] Generating src/org/opencv/core/Range.java
[ 83%] Generating src/org/opencv/core/TermCriteria.java
[ 84%] Generating src/org/opencv/core/KeyPoint.java
[ 84%] Generating src/org/opencv/core/MatOfPoint3f.java
[ 84%] Generating src/org/opencv/core/MatOfInt4.java
[ 84%] Generating src/org/opencv/imgproc/Moments.java
[ 84%] Generating opencv-310.jar
BUILD SUCCESSFUL
Total time: 1 second
[ 87%] Built target opencv_java
[ 87%] Built target opencv_test_java_properties
[ 87%] Copying the OpenCV jar
[ 87%] Build Java tests
Buildfile: /home/wanghs/opencv-3.1.0/build/modules/java/pure_test/.build/build.xml
build:
compile:
[javac] Compiling 2 source files to /home/wanghs/opencv-3.1.0/build/modules/java/pure_test/.build/build/classes
jar:
[jar] Building jar: /home/wanghs/opencv-3.1.0/build/modules/java/pure_test/.build/build/jar/opencv-test.jar
BUILD SUCCESSFUL
Total time: 0 seconds
[ 97%] Built target opencv_test_java
[ 97%] Built target opencv_perf_stitching
[ 98%] Built target opencv_test_stitching
[ 98%] Generating pyopencv_generated_include.h, pyopencv_generated_funcs.h, pyopencv_generated_types.h, pyopencv_generated_type_reg.h, pyopencv_generated_ns_reg.h
Scanning dependencies of target opencv_python2
[100%] Building CXX object modules/python2/CMakeFiles/opencv_python2.dir/__/src2/cv2.cpp.o
Linking CXX shared module ../../lib/cv2.so
[100%] Built target opencv_python2
[100%] Built target opencv_traincascade
[100%] Built target opencv_createsamples
[100%] Built target opencv_annotation
[wanghs@db2 build]$ sudo make install
[ 5%] Built target libtiff
[ 10%] Built target libwebp
[ 12%] Built target libjasper
[ 20%] Built target IlmImf
[ 25%] Built target opencv_core
[ 30%] Built target opencv_imgproc
[ 32%] Built target opencv_imgcodecs
[ 32%] Built target opencv_videoio
[ 32%] Built target opencv_highgui
[ 33%] Built target opencv_ts
[ 35%] Built target opencv_perf_core
[ 39%] Built target opencv_test_core
[ 41%] Built target opencv_flann
[ 41%] Built target opencv_test_flann
[ 44%] Built target opencv_perf_imgproc
[ 50%] Built target opencv_test_imgproc
[ 51%] Built target opencv_ml
[ 51%] Built target opencv_test_ml
[ 52%] Built target opencv_photo
[ 53%] Built target opencv_perf_photo
[ 55%] Built target opencv_test_photo
[ 56%] Built target opencv_video
[ 57%] Built target opencv_perf_video
[ 58%] Built target opencv_test_video
[ 58%] Built target opencv_perf_imgcodecs
[ 58%] Built target opencv_test_imgcodecs
[ 58%] Built target opencv_shape
[ 58%] Built target opencv_test_shape
[ 58%] Built target opencv_perf_videoio
[ 60%] Built target opencv_test_videoio
[ 60%] Built target opencv_test_highgui
[ 61%] Built target opencv_objdetect
[ 61%] Built target opencv_perf_objdetect
[ 61%] Built target opencv_test_objdetect
[ 62%] Built target opencv_superres
[ 62%] Built target opencv_perf_superres
[ 62%] Built target opencv_test_superres
[ 65%] Built target opencv_features2d
[ 66%] Built target opencv_perf_features2d
[ 67%] Built target opencv_test_features2d
[ 70%] Built target opencv_calib3d
[ 70%] Built target opencv_perf_calib3d
[ 73%] Built target opencv_test_calib3d
[ 74%] Built target opencv_videostab
[ 75%] Built target opencv_stitching
[ 87%] Built target opencv_java
[ 87%] Built target opencv_test_java_properties
[ 97%] Built target opencv_test_java
[ 97%] Built target opencv_perf_stitching
[ 98%] Built target opencv_test_stitching
[100%] Built target opencv_python2
[100%] Built target opencv_traincascade
[100%] Built target opencv_createsamples
[100%] Built target opencv_annotation
Linking CXX shared module CMakeFiles/CMakeRelink.dir/cv2.so
Install the project...
-- Install configuration: "Release"
-- Installing: /usr/local/share/OpenCV/3rdparty/lib/libippicv.a
-- Installing: /usr/local/include/opencv2/cvconfig.h
-- Installing: /usr/local/include/opencv2/opencv_modules.hpp
-- Installing: /usr/local/lib/pkgconfig/opencv.pc
-- Installing: /usr/local/share/OpenCV/OpenCVConfig.cmake
-- Installing: /usr/local/share/OpenCV/OpenCVConfig-version.cmake
-- Installing: /usr/local/share/OpenCV/OpenCVModules.cmake
-- Installing: /usr/local/share/OpenCV/OpenCVModules-release.cmake
-- Installing: /usr/local/share/OpenCV/3rdparty/lib/liblibtiff.a
-- Installing: /usr/local/share/OpenCV/3rdparty/lib/liblibwebp.a
-- Installing: /usr/local/share/OpenCV/3rdparty/lib/liblibjasper.a
-- Installing: /usr/local/share/OpenCV/3rdparty/lib/libIlmImf.a
-- Installing: /usr/local/include/opencv/highgui.h
-- Installing: /usr/local/include/opencv/cxeigen.hpp
-- Installing: /usr/local/include/opencv/cvaux.hpp
-- Installing: /usr/local/include/opencv/cv.hpp
-- Installing: /usr/local/include/opencv/cvaux.h
-- Installing: /usr/local/include/opencv/cxcore.h
-- Installing: /usr/local/include/opencv/cxcore.hpp
-- Installing: /usr/local/include/opencv/cvwimage.h
-- Installing: /usr/local/include/opencv/ml.h
-- Installing: /usr/local/include/opencv/cxmisc.h
-- Installing: /usr/local/include/opencv/cv.h
-- Installing: /usr/local/include/opencv2/opencv.hpp
-- Installing: /usr/local/lib/libopencv_core.a
-- Installing: /usr/local/include/opencv2/core/cuda/funcattrib.hpp
-- Installing: /usr/local/include/opencv2/core/cuda/border_interpolate.hpp
-- Installing: /usr/local/include/opencv2/core/cuda/simd_functions.hpp
-- Installing: /usr/local/include/opencv2/core/cuda/emulation.hpp
-- Installing: /usr/local/include/opencv2/core/cuda/limits.hpp
-- Installing: /usr/local/include/opencv2/core/cuda/block.hpp
-- Installing: /usr/local/include/opencv2/core/cuda/functional.hpp
-- Installing: /usr/local/include/opencv2/core/cuda/color.hpp
-- Installing: /usr/local/include/opencv2/core/cuda/utility.hpp
-- Installing: /usr/local/include/opencv2/core/cuda/scan.hpp
-- Installing: /usr/local/include/opencv2/core/cuda/vec_traits.hpp
-- Installing: /usr/local/include/opencv2/core/cuda/dynamic_smem.hpp
-- Installing: /usr/local/include/opencv2/core/cuda/datamov_utils.hpp
-- Installing: /usr/local/include/opencv2/core/cuda/vec_math.hpp
-- Installing: /usr/local/include/opencv2/core/cuda/transform.hpp
-- Installing: /usr/local/include/opencv2/core/cuda/type_traits.hpp
-- Installing: /usr/local/include/opencv2/core/cuda/vec_distance.hpp
-- Installing: /usr/local/include/opencv2/core/cuda/filters.hpp
-- Installing: /usr/local/include/opencv2/core/cuda/common.hpp
-- Installing: /usr/local/include/opencv2/core/cuda/warp.hpp
-- Installing: /usr/local/include/opencv2/core/cuda/reduce.hpp
-- Installing: /usr/local/include/opencv2/core/cuda/warp_shuffle.hpp
-- Installing: /usr/local/include/opencv2/core/cuda/saturate_cast.hpp
-- Installing: /usr/local/include/opencv2/core/cuda/warp_reduce.hpp
-- Installing: /usr/local/include/opencv2/core/cuda/detail/vec_distance_detail.hpp
-- Installing: /usr/local/include/opencv2/core/cuda/detail/transform_detail.hpp
-- Installing: /usr/local/include/opencv2/core/cuda/detail/type_traits_detail.hpp
-- Installing: /usr/local/include/opencv2/core/cuda/detail/reduce_key_val.hpp
-- Installing: /usr/local/include/opencv2/core/cuda/detail/reduce.hpp
-- Installing: /usr/local/include/opencv2/core/cuda/detail/color_detail.hpp
-- Installing: /usr/local/include/opencv2/core.hpp
-- Installing: /usr/local/include/opencv2/core/operations.hpp
-- Installing: /usr/local/include/opencv2/core/private.cuda.hpp
-- Installing: /usr/local/include/opencv2/core/cvstd.inl.hpp
-- Installing: /usr/local/include/opencv2/core/mat.inl.hpp
-- Installing: /usr/local/include/opencv2/core/version.hpp
-- Installing: /usr/local/include/opencv2/core/ocl_genbase.hpp
-- Installing: /usr/local/include/opencv2/core/cuda_stream_accessor.hpp
-- Installing: /usr/local/include/opencv2/core/types.hpp
-- Installing: /usr/local/include/opencv2/core/optim.hpp
-- Installing: /usr/local/include/opencv2/core/persistence.hpp
-- Installing: /usr/local/include/opencv2/core/ippasync.hpp
-- Installing: /usr/local/include/opencv2/core/neon_utils.hpp
-- Installing: /usr/local/include/opencv2/core/utility.hpp
-- Installing: /usr/local/include/opencv2/core/private.hpp
-- Installing: /usr/local/include/opencv2/core/bufferpool.hpp
-- Installing: /usr/local/include/opencv2/core/matx.hpp
-- Installing: /usr/local/include/opencv2/core/wimage.hpp
-- Installing: /usr/local/include/opencv2/core/fast_math.hpp
-- Installing: /usr/local/include/opencv2/core/cuda.hpp
-- Installing: /usr/local/include/opencv2/core/directx.hpp
-- Installing: /usr/local/include/opencv2/core/ptr.inl.hpp
-- Installing: /usr/local/include/opencv2/core/eigen.hpp
-- Installing: /usr/local/include/opencv2/core/traits.hpp
-- Installing: /usr/local/include/opencv2/core/va_intel.hpp
-- Installing: /usr/local/include/opencv2/core/saturate.hpp
-- Installing: /usr/local/include/opencv2/core/opengl.hpp
-- Installing: /usr/local/include/opencv2/core/cvstd.hpp
-- Installing: /usr/local/include/opencv2/core/base.hpp
-- Installing: /usr/local/include/opencv2/core/affine.hpp
-- Installing: /usr/local/include/opencv2/core/cuda_types.hpp
-- Installing: /usr/local/include/opencv2/core/sse_utils.hpp
-- Installing: /usr/local/include/opencv2/core/core.hpp
-- Installing: /usr/local/include/opencv2/core/mat.hpp
-- Installing: /usr/local/include/opencv2/core/cuda.inl.hpp
-- Installing: /usr/local/include/opencv2/core/ocl.hpp
-- Installing: /usr/local/include/opencv2/core/core_c.h
-- Installing: /usr/local/include/opencv2/core/cvdef.h
-- Installing: /usr/local/include/opencv2/core/types_c.h
-- Installing: /usr/local/include/opencv2/core/hal/intrin_cpp.hpp
-- Installing: /usr/local/include/opencv2/core/hal/intrin_sse.hpp
-- Installing: /usr/local/include/opencv2/core/hal/intrin.hpp
-- Installing: /usr/local/include/opencv2/core/hal/hal.hpp
-- Installing: /usr/local/include/opencv2/core/hal/intrin_neon.hpp
-- Installing: /usr/local/include/opencv2/core/hal/interface.h
-- Installing: /usr/local/lib/libopencv_flann.a
-- Installing: /usr/local/include/opencv2/flann.hpp
-- Installing: /usr/local/include/opencv2/flann/flann.hpp
-- Installing: /usr/local/include/opencv2/flann/flann_base.hpp
-- Installing: /usr/local/include/opencv2/flann/miniflann.hpp
-- Installing: /usr/local/include/opencv2/flann/matrix.h
-- Installing: /usr/local/include/opencv2/flann/sampling.h
-- Installing: /usr/local/include/opencv2/flann/kdtree_single_index.h
-- Installing: /usr/local/include/opencv2/flann/config.h
-- Installing: /usr/local/include/opencv2/flann/kmeans_index.h
-- Installing: /usr/local/include/opencv2/flann/result_set.h
-- Installing: /usr/local/include/opencv2/flann/logger.h
-- Installing: /usr/local/include/opencv2/flann/lsh_table.h
-- Installing: /usr/local/include/opencv2/flann/dynamic_bitset.h
-- Installing: /usr/local/include/opencv2/flann/nn_index.h
-- Installing: /usr/local/include/opencv2/flann/params.h
-- Installing: /usr/local/include/opencv2/flann/composite_index.h
-- Installing: /usr/local/include/opencv2/flann/random.h
-- Installing: /usr/local/include/opencv2/flann/ground_truth.h
-- Installing: /usr/local/include/opencv2/flann/heap.h
-- Installing: /usr/local/include/opencv2/flann/timer.h
-- Installing: /usr/local/include/opencv2/flann/lsh_index.h
-- Installing: /usr/local/include/opencv2/flann/index_testing.h
-- Installing: /usr/local/include/opencv2/flann/hdf5.h
-- Installing: /usr/local/include/opencv2/flann/general.h
-- Installing: /usr/local/include/opencv2/flann/defines.h
-- Installing: /usr/local/include/opencv2/flann/object_factory.h
-- Installing: /usr/local/include/opencv2/flann/autotuned_index.h
-- Installing: /usr/local/include/opencv2/flann/kdtree_index.h
-- Installing: /usr/local/include/opencv2/flann/saving.h
-- Installing: /usr/local/include/opencv2/flann/dist.h
-- Installing: /usr/local/include/opencv2/flann/all_indices.h
-- Installing: /usr/local/include/opencv2/flann/any.h
-- Installing: /usr/local/include/opencv2/flann/simplex_downhill.h
-- Installing: /usr/local/include/opencv2/flann/hierarchical_clustering_index.h
-- Installing: /usr/local/include/opencv2/flann/allocator.h
-- Installing: /usr/local/include/opencv2/flann/linear_index.h
-- Installing: /usr/local/include/opencv2/flann/dummy.h
-- Installing: /usr/local/lib/libopencv_imgproc.a
-- Installing: /usr/local/include/opencv2/imgproc.hpp
-- Installing: /usr/local/include/opencv2/imgproc/imgproc.hpp
-- Installing: /usr/local/include/opencv2/imgproc/imgproc_c.h
-- Installing: /usr/local/include/opencv2/imgproc/types_c.h
-- Installing: /usr/local/include/opencv2/imgproc/detail/distortion_model.hpp
-- Installing: /usr/local/lib/libopencv_ml.a
-- Installing: /usr/local/include/opencv2/ml.hpp
-- Installing: /usr/local/include/opencv2/ml/ml.hpp
-- Installing: /usr/local/lib/libopencv_photo.a
-- Installing: /usr/local/include/opencv2/photo.hpp
-- Installing: /usr/local/include/opencv2/photo/cuda.hpp
-- Installing: /usr/local/include/opencv2/photo/photo.hpp
-- Installing: /usr/local/include/opencv2/photo/photo_c.h
-- Installing: /usr/local/lib/libopencv_video.a
-- Installing: /usr/local/include/opencv2/video.hpp
-- Installing: /usr/local/include/opencv2/video/tracking.hpp
-- Installing: /usr/local/include/opencv2/video/video.hpp
-- Installing: /usr/local/include/opencv2/video/background_segm.hpp
-- Installing: /usr/local/include/opencv2/video/tracking_c.h
-- Installing: /usr/local/lib/libopencv_imgcodecs.a
-- Installing: /usr/local/include/opencv2/imgcodecs.hpp
-- Installing: /usr/local/include/opencv2/imgcodecs/imgcodecs.hpp
-- Installing: /usr/local/include/opencv2/imgcodecs/imgcodecs_c.h
-- Installing: /usr/local/include/opencv2/imgcodecs/ios.h
-- Installing: /usr/local/lib/libopencv_shape.a
-- Installing: /usr/local/include/opencv2/shape.hpp
-- Installing: /usr/local/include/opencv2/shape/shape.hpp
-- Installing: /usr/local/include/opencv2/shape/shape_distance.hpp
-- Installing: /usr/local/include/opencv2/shape/shape_transformer.hpp
-- Installing: /usr/local/include/opencv2/shape/emdL1.hpp
-- Installing: /usr/local/include/opencv2/shape/hist_cost.hpp
-- Installing: /usr/local/lib/libopencv_videoio.a
-- Installing: /usr/local/include/opencv2/videoio.hpp
-- Installing: /usr/local/include/opencv2/videoio/videoio.hpp
-- Installing: /usr/local/include/opencv2/videoio/cap_ios.h
-- Installing: /usr/local/include/opencv2/videoio/videoio_c.h
-- Installing: /usr/local/lib/libopencv_highgui.a
-- Installing: /usr/local/include/opencv2/highgui.hpp
-- Installing: /usr/local/include/opencv2/highgui/highgui.hpp
-- Installing: /usr/local/include/opencv2/highgui/highgui_c.h
-- Installing: /usr/local/lib/libopencv_objdetect.a
-- Installing: /usr/local/include/opencv2/objdetect.hpp
-- Installing: /usr/local/include/opencv2/objdetect/detection_based_tracker.hpp
-- Installing: /usr/local/include/opencv2/objdetect/objdetect.hpp
-- Installing: /usr/local/include/opencv2/objdetect/objdetect_c.h
-- Installing: /usr/local/lib/libopencv_superres.a
-- Installing: /usr/local/include/opencv2/superres.hpp
-- Installing: /usr/local/include/opencv2/superres/optical_flow.hpp
-- Installing: /usr/local/lib/libopencv_ts.a
-- Installing: /usr/local/lib/libopencv_features2d.a
-- Installing: /usr/local/include/opencv2/features2d.hpp
-- Installing: /usr/local/include/opencv2/features2d/features2d.hpp
-- Installing: /usr/local/lib/libopencv_calib3d.a
-- Installing: /usr/local/include/opencv2/calib3d.hpp
-- Installing: /usr/local/include/opencv2/calib3d/calib3d.hpp
-- Installing: /usr/local/include/opencv2/calib3d/calib3d_c.h
-- Installing: /usr/local/share/OpenCV/java/opencv-310.jar
-- Installing: /usr/local/share/OpenCV/java/libopencv_java310.so
-- Installing: /usr/local/lib/libopencv_stitching.a
-- Installing: /usr/local/include/opencv2/stitching.hpp
-- Installing: /usr/local/include/opencv2/stitching/warpers.hpp
-- Installing: /usr/local/include/opencv2/stitching/detail/seam_finders.hpp
-- Installing: /usr/local/include/opencv2/stitching/detail/exposure_compensate.hpp
-- Installing: /usr/local/include/opencv2/stitching/detail/autocalib.hpp
-- Installing: /usr/local/include/opencv2/stitching/detail/warpers_inl.hpp
-- Installing: /usr/local/include/opencv2/stitching/detail/blenders.hpp
-- Installing: /usr/local/include/opencv2/stitching/detail/matchers.hpp
-- Installing: /usr/local/include/opencv2/stitching/detail/util.hpp
-- Installing: /usr/local/include/opencv2/stitching/detail/util_inl.hpp
-- Installing: /usr/local/include/opencv2/stitching/detail/camera.hpp
-- Installing: /usr/local/include/opencv2/stitching/detail/timelapsers.hpp
-- Installing: /usr/local/include/opencv2/stitching/detail/motion_estimators.hpp
-- Installing: /usr/local/include/opencv2/stitching/detail/warpers.hpp
-- Installing: /usr/local/lib/libopencv_videostab.a
-- Installing: /usr/local/include/opencv2/videostab.hpp
-- Installing: /usr/local/include/opencv2/videostab/ring_buffer.hpp
-- Installing: /usr/local/include/opencv2/videostab/inpainting.hpp
-- Installing: /usr/local/include/opencv2/videostab/outlier_rejection.hpp
-- Installing: /usr/local/include/opencv2/videostab/log.hpp
-- Installing: /usr/local/include/opencv2/videostab/motion_stabilizing.hpp
-- Installing: /usr/local/include/opencv2/videostab/motion_core.hpp
-- Installing: /usr/local/include/opencv2/videostab/fast_marching_inl.hpp
-- Installing: /usr/local/include/opencv2/videostab/deblurring.hpp
-- Installing: /usr/local/include/opencv2/videostab/optical_flow.hpp
-- Installing: /usr/local/include/opencv2/videostab/fast_marching.hpp
-- Installing: /usr/local/include/opencv2/videostab/wobble_suppression.hpp
-- Installing: /usr/local/include/opencv2/videostab/global_motion.hpp
-- Installing: /usr/local/include/opencv2/videostab/stabilizer.hpp
-- Installing: /usr/local/include/opencv2/videostab/frame_source.hpp
-- Installing: /usr/local/lib/python2.7/site-packages/cv2.so
-- Installing: /usr/local/share/OpenCV/haarcascades/haarcascade_lefteye_2splits.xml
-- Installing: /usr/local/share/OpenCV/haarcascades/haarcascade_frontalface_alt.xml
-- Installing: /usr/local/share/OpenCV/haarcascades/haarcascade_eye_tree_eyeglasses.xml
-- Installing: /usr/local/share/OpenCV/haarcascades/haarcascade_smile.xml
-- Installing: /usr/local/share/OpenCV/haarcascades/haarcascade_profileface.xml
-- Installing: /usr/local/share/OpenCV/haarcascades/haarcascade_frontalface_alt_tree.xml
-- Installing: /usr/local/share/OpenCV/haarcascades/haarcascade_frontalcatface_extended.xml
-- Installing: /usr/local/share/OpenCV/haarcascades/haarcascade_russian_plate_number.xml
-- Installing: /usr/local/share/OpenCV/haarcascades/haarcascade_fullbody.xml
-- Installing: /usr/local/share/OpenCV/haarcascades/haarcascade_righteye_2splits.xml
-- Installing: /usr/local/share/OpenCV/haarcascades/haarcascade_eye.xml
-- Installing: /usr/local/share/OpenCV/haarcascades/haarcascade_frontalcatface.xml
-- Installing: /usr/local/share/OpenCV/haarcascades/haarcascade_lowerbody.xml
-- Installing: /usr/local/share/OpenCV/haarcascades/haarcascade_frontalface_alt2.xml
-- Installing: /usr/local/share/OpenCV/haarcascades/haarcascade_licence_plate_rus_16stages.xml
-- Installing: /usr/local/share/OpenCV/haarcascades/haarcascade_upperbody.xml
-- Installing: /usr/local/share/OpenCV/haarcascades/haarcascade_frontalface_default.xml
-- Installing: /usr/local/share/OpenCV/lbpcascades/lbpcascade_profileface.xml
-- Installing: /usr/local/share/OpenCV/lbpcascades/lbpcascade_silverware.xml
-- Installing: /usr/local/share/OpenCV/lbpcascades/lbpcascade_frontalface.xml
-- Installing: /usr/local/share/OpenCV/lbpcascades/lbpcascade_frontalcatface.xml
-- Installing: /usr/local/bin/opencv_traincascade
-- Installing: /usr/local/bin/opencv_createsamples
-- Installing: /usr/local/bin/opencv_annotation
Cat /etc/profile
export PKG_CONFIG_PATH=/usr/local/lib/pkgconfig:$PKG_CONFIG_PATH
export LD_LIBRARY_PATH=/usr/local/lib:$LD_LIBRARY_PATH
[wanghs@db2 mxnet]$ pkg-config --libs opencv
-L/usr/local/lib -lopencv_calib3d -lopencv_core -lopencv_features2d -lopencv_flann -lopencv_highgui -lopencv_imgcodecs -lopencv_imgproc -lopencv_ml -lopencv_objdetect -lopencv_photo -lopencv_shape -lopencv_stitching -lopencv_superres -lopencv_video -lopencv_videoio -lopencv_videostab
config.mk
[wanghs@db2 mxnet]$ cat config.mk
#-------------------------------------------------------------------------------
# Template configuration for compiling mxnet
#
# If you want to change the configuration, please use the following
# steps. Assume you are on the root directory of mxnet. First copy the this
# file so that any local changes will be ignored by git
#
# $ cp make/config.mk .
#
# Next modify the according entries, and then compile by
#
# $ make
#
# or build in parallel with 8 threads
#
# $ make -j8
#-------------------------------------------------------------------------------
#---------------------
# choice of compiler
#--------------------
export CC = gcc
export CXX = g++
export NVCC = nvcc
# whether compile with debug
DEBUG = 0
# the additional link flags you want to add
#ADD_LDFLAGS =
ADD_LDFLAGS = -L /opt/OpenBLAS/lib
# the additional compile flags you want to add
#ADD_CFLAGS =
ADD_CFLAGS = -I /opt/OpenBLAS/include
#---------------------------------------------
# matrix computation libraries for CPU/GPU
#---------------------------------------------
# whether use CUDA during compile
USE_CUDA = 0
# add the path to CUDA library to link and compile flag
# if you have already add them to environment variable, leave it as NONE
# USE_CUDA_PATH = /usr/local/cuda
USE_CUDA_PATH = NONE
# whether use CuDNN R3 library
USE_CUDNN = 0
# whether use cuda runtime compiling for writing kernels in native language (i.e. Python)
USE_NVRTC = 0
# whether use opencv during compilation
# you can disable it, however, you will not able to use
# imbin iterator
USE_OPENCV = 1
# use openmp for parallelization
USE_OPENMP = 1
# choose the version of blas you want to use
# can be: mkl, blas, atlas, openblas
# in default use atlas for linux while apple for osx
UNAME_S := $(shell uname -s)
ifeq ($(UNAME_S), Darwin)
USE_BLAS = apple
else
USE_BLAS = atlas
endif
# add path to intel library, you may need it for MKL, if you did not add the path
# to environment variable
USE_INTEL_PATH = NONE
# If use MKL, choose static link automatically to allow python wrapper
ifeq ($(USE_BLAS), mkl)
USE_STATIC_MKL = 1
else
USE_STATIC_MKL = NONE
endif
#----------------------------
# Settings for power arch
#----------------------------
ARCH := $(shell uname -a)
ifneq (,$(filter $(ARCH), powerpc64le ppc64le))
USE_SSE=0
else
USE_SSE=1
endif
#----------------------------
# distributed computing
#----------------------------
# whether or not to enable multi-machine supporting
USE_DIST_KVSTORE = 0
# whether or not allow to read and write HDFS directly. If yes, then hadoop is
# required
USE_HDFS = 0
# path to libjvm.so. required if USE_HDFS=1
LIBJVM=$(JAVA_HOME)/jre/lib/amd64/server
# whether or not allow to read and write AWS S3 directly. If yes, then
# libcurl4-openssl-dev is required, it can be installed on Ubuntu by
# sudo apt-get install -y libcurl4-openssl-dev
USE_S3 = 0
#----------------------------
# additional operators
#----------------------------
# path to folders containing projects specific operators that you don't want to put in src/operators
EXTRA_OPERATORS =
#----------------------------
# plugins
#----------------------------
# whether to use caffe integration. This requires installing caffe.
# You also need to add CAFFE_PATH/build/lib to your LD_LIBRARY_PATH
# CAFFE_PATH = $(HOME)/caffe
# MXNET_PLUGINS += plugin/caffe/caffe.mk
# whether to use torch integration. This requires installing torch.
# You also need to add TORCH_PATH/install/lib to your LD_LIBRARY_PATH
# TORCH_PATH = $(HOME)/torch
# MXNET_PLUGINS += plugin/torch/torch.mk
WARPCTC_PATH = $(HOME)/warp-ctc
MXNET_PLUGINS += plugin/warpctc/warpctc.mk
# whether to use sframe integration. This requires build sframe
# [email protected]:dato-code/SFrame.git
# SFRAME_PATH = $(HOME)/SFrame
# MXNET_PLUGINS += plugin/sframe/plugin.mk
#
#
USE_BLAS = openblas
change Makefile because opencv_legacy is gone in openCV3
# setup opencv
ifeq ($(USE_OPENCV), 1)
CFLAGS += -DMXNET_USE_OPENCV=1 `pkg-config --cflags opencv`
LDFLAGS += `pkg-config --libs opencv`
# LDFLAGS += -lopencv_calib3d -lopencv_imgproc -lopencv_contrib -lopencv_legacy -lopencv_core -lopencv_highgui
BIN += bin/im2rec
[wanghs@db2 mxnet]$ cd example/warpctc/
[wanghs@db2 warpctc]$ python lstm
lstm_ocr.py lstm.py
[wanghs@db2 warpctc]$ python lstm_ocr.py
Traceback (most recent call last):
File "lstm_ocr.py", line 6, in <module>
import mxnet as mx
File "../../python/mxnet/__init__.py", line 7, in <module>
from .base import MXNetError
File "../../python/mxnet/base.py", line 43, in <module>
_LIB = _load_lib()
File "../../python/mxnet/base.py", line 35, in _load_lib
lib = ctypes.cdll.LoadLibrary(lib_path[0])
File "/usr/lib64/python2.7/ctypes/__init__.py", line 438, in LoadLibrary
return self._dlltype(name)
File "/usr/lib64/python2.7/ctypes/__init__.py", line 360, in __init__
self._handle = _dlopen(self._name, mode)
OSError: libopenblas.so.0: cannot open shared object file: No such file or directory
export LD_LIBRARY_PATH=/opt/OpenBLAS/lib/:$LD_LIBRARY_PATH
[wanghs@db2 warpctc]$ python lstm_ocr.py
Traceback (most recent call last):
File "lstm_ocr.py", line 6, in <module>
import mxnet as mx
File "../../python/mxnet/__init__.py", line 7, in <module>
from .base import MXNetError
File "../../python/mxnet/base.py", line 43, in <module>
_LIB = _load_lib()
File "../../python/mxnet/base.py", line 35, in _load_lib
lib = ctypes.cdll.LoadLibrary(lib_path[0])
File "/usr/lib64/python2.7/ctypes/__init__.py", line 438, in LoadLibrary
return self._dlltype(name)
File "/usr/lib64/python2.7/ctypes/__init__.py", line 360, in __init__
self._handle = _dlopen(self._name, mode)
OSError: libwarpctc.so: cannot open shared object file: No such file or directory
[wanghs@db2 warpctc]$ locate libwarpctc.so
/home/wanghs/ocr/host-torch7/torch/install/lib/libwarpctc.so
/home/wanghs/warp-ctc/build/libwarpctc.so
[wanghs@db2 warpctc]$
export LD_LIBRARY_PATH=/home/wanghs/warp-ctc/build/:$LD_LIBRARY_PATH
export LD_LIBRARY_PATH=/home/wanghs/ocr/host-torch7/torch/install/lib/:$LD_LIBRARY_PATH
[wanghs@db2 warpctc]$ python lstm_ocr.py
Traceback (most recent call last):
File "lstm_ocr.py", line 11, in <module>
from captcha.image import ImageCaptcha
ImportError: No module named captcha.image
修改 toy_ctc.py lstm_ocr.py 即可使用多cpu进行训练
contexts = [mx.context.cpu(8)]
[wanghs@db2 build]$ cmake -DBUILD_SHARED_LIBS=OFF -DENABLE_PRECOMPILED_HEADERS=OFF .. -- Detected version of GNU GCC: 48 (408) -- Found ZLIB: /lib64/libz.so (found suitable version "1.2.7", minimum required is "1.2.3") -- Could NOT find TIFF (missing: TIFF_LIBRARY TIFF_INCLUDE_DIR) -- Could NOT find Jasper (missing: JASPER_LIBRARIES JASPER_INCLUDE_DIR) -- Found ZLIB: /lib64/libz.so (found version "1.2.7") -- checking for module 'gstreamer-base-1.0' -- package 'gstreamer-base-1.0' not found -- checking for module 'gstreamer-video-1.0' -- package 'gstreamer-video-1.0' not found -- checking for module 'gstreamer-app-1.0' -- package 'gstreamer-app-1.0' not found -- checking for module 'gstreamer-riff-1.0' -- package 'gstreamer-riff-1.0' not found -- checking for module 'gstreamer-pbutils-1.0' -- package 'gstreamer-pbutils-1.0' not found -- checking for module 'gstreamer-base-0.10' -- package 'gstreamer-base-0.10' not found -- checking for module 'gstreamer-video-0.10' -- package 'gstreamer-video-0.10' not found -- checking for module 'gstreamer-app-0.10' -- package 'gstreamer-app-0.10' not found -- checking for module 'gstreamer-riff-0.10' -- package 'gstreamer-riff-0.10' not found -- checking for module 'gstreamer-pbutils-0.10' -- package 'gstreamer-pbutils-0.10' not found -- checking for module 'libdc1394-2' -- package 'libdc1394-2' not found -- checking for module 'libdc1394' -- package 'libdc1394' not found -- checking for module 'libv4l1' -- package 'libv4l1' not found -- checking for module 'libv4l2' -- package 'libv4l2' not found -- Looking for linux/videodev.h -- Looking for linux/videodev.h - not found -- Looking for linux/videodev2.h -- Looking for linux/videodev2.h - found -- Looking for sys/videoio.h -- Looking for sys/videoio.h - not found -- checking for module 'libavcodec' -- package 'libavcodec' not found -- checking for module 'libavformat' -- package 'libavformat' not found -- checking for module 'libavutil' -- package 'libavutil' not found -- checking for module 'libswscale' -- package 'libswscale' not found -- checking for module 'libavresample' -- package 'libavresample' not found -- Looking for libavformat/avformat.h -- Looking for libavformat/avformat.h - not found -- Looking for ffmpeg/avformat.h -- Looking for ffmpeg/avformat.h - not found -- checking for module 'libgphoto2' -- package 'libgphoto2' not found -- found IPP (ICV version): 9.0.1 [9.0.1] -- at: /home/wanghs/opencv-3.1.0/3rdparty/ippicv/unpack/ippicv_lnx -- To enable PlantUML support, set PLANTUML_JAR environment variable or pass -DPLANTUML_JAR= option to cmake -- Could NOT find PythonInterp: Found unsuitable version "1.4", but required is at least "3.4" (found /home/wanghs/.pyenv/shims/python3.4) -- Could NOT find PythonInterp: Found unsuitable version "1.4", but required is at least "3.2" (found /home/wanghs/.pyenv/shims/python3.4) -- Found apache ant 1.9.2: /bin/ant -- Could NOT find Matlab (missing: MATLAB_MEX_SCRIPT MATLAB_INCLUDE_DIRS MATLAB_ROOT_DIR MATLAB_LIBRARIES MATLAB_LIBRARY_DIRS MATLAB_MEXEXT MATLAB_ARCH MATLAB_BIN) -- VTK is not found. Please set -DVTK_DIR in CMake to VTK build directory, or to VTK install subdirectory with VTKConfig.cmake file
-- General configuration for OpenCV 3.1.0 ===================================== -- Version control: unknown
-- Platform: -- Host: Linux 3.10.0-327.13.1.el7.x86_64 x86_64 -- CMake: 2.8.11 -- CMake generator: Unix Makefiles -- CMake build tool: /usr/bin/gmake -- Configuration: Release
-- C/C++: -- Built as dynamic libs?: NO -- C++ Compiler: /usr/bin/c++ (ver 4.8.5) -- C++ flags (Release): -fPIC -fsigned-char -W -Wall -Werror=return-type -Werror=non-virtual-dtor -Werror=address -Werror=sequence-point -Wformat -Werror=format-security -Wmissing-declarations -Wundef -Winit-self -Wpointer-arith -Wshadow -Wsign-promo -Wno-narrowing -Wno-delete-non-virtual-dtor -Wno-unnamed-type-template-args -fdiagnostics-show-option -Wno-long-long -pthread -fomit-frame-pointer -msse -msse2 -mno-avx -msse3 -mno-ssse3 -mno-sse4.1 -mno-sse4.2 -ffunction-sections -fvisibility=hidden -fvisibility-inlines-hidden -O3 -DNDEBUG -DNDEBUG -- C++ flags (Debug): -fPIC -fsigned-char -W -Wall -Werror=return-type -Werror=non-virtual-dtor -Werror=address -Werror=sequence-point -Wformat -Werror=format-security -Wmissing-declarations -Wundef -Winit-self -Wpointer-arith -Wshadow -Wsign-promo -Wno-narrowing -Wno-delete-non-virtual-dtor -Wno-unnamed-type-template-args -fdiagnostics-show-option -Wno-long-long -pthread -fomit-frame-pointer -msse -msse2 -mno-avx -msse3 -mno-ssse3 -mno-sse4.1 -mno-sse4.2 -ffunction-sections -fvisibility=hidden -fvisibility-inlines-hidden -g -O0 -DDEBUG -D_DEBUG -- C Compiler: /usr/bin/cc -- C flags (Release): -fPIC -fsigned-char -W -Wall -Werror=return-type -Werror=non-virtual-dtor -Werror=address -Werror=sequence-point -Wformat -Werror=format-security -Wmissing-declarations -Wmissing-prototypes -Wstrict-prototypes -Wundef -Winit-self -Wpointer-arith -Wshadow -Wno-narrowing -Wno-unnamed-type-template-args -fdiagnostics-show-option -Wno-long-long -pthread -fomit-frame-pointer -msse -msse2 -mno-avx -msse3 -mno-ssse3 -mno-sse4.1 -mno-sse4.2 -ffunction-sections -fvisibility=hidden -O3 -DNDEBUG -DNDEBUG -- C flags (Debug): -fPIC -fsigned-char -W -Wall -Werror=return-type -Werror=non-virtual-dtor -Werror=address -Werror=sequence-point -Wformat -Werror=format-security -Wmissing-declarations -Wmissing-prototypes -Wstrict-prototypes -Wundef -Winit-self -Wpointer-arith -Wshadow -Wno-narrowing -Wno-unnamed-type-template-args -fdiagnostics-show-option -Wno-long-long -pthread -fomit-frame-pointer -msse -msse2 -mno-avx -msse3 -mno-ssse3 -mno-sse4.1 -mno-sse4.2 -ffunction-sections -fvisibility=hidden -g -O0 -DDEBUG -D_DEBUG -- Linker flags (Release): -- Linker flags (Debug): -- Precompiled headers: NO -- Extra dependencies: stdc++ dl m pthread rt -- 3rdparty dependencies: ippicv
-- OpenCV modules: -- To be built: core flann imgproc ml photo video imgcodecs shape videoio highgui objdetect superres ts features2d calib3d java stitching videostab python2 -- Disabled: world -- Disabled by dependency: - -- Unavailable: cudaarithm cudabgsegm cudacodec cudafeatures2d cudafilters cudaimgproc cudalegacy cudaobjdetect cudaoptflow cudastereo cudawarping cudev python3 viz
-- GUI: -- QT: NO -- GTK+ 3.x: YES (ver 3.14.13) -- GThread : YES (ver 2.42.2) -- GtkGlExt: NO -- OpenGL support: NO -- VTK support: NO
-- Media I/O: -- ZLib: /lib64/libz.so (ver 1.2.7) -- JPEG: /lib64/libjpeg.so (ver ) -- WEBP: build (ver 0.3.1) -- PNG: /lib64/libpng.so (ver 1.5.13) -- TIFF: build (ver 42 - 4.0.2) -- JPEG 2000: build (ver 1.900.1) -- OpenEXR: build (ver 1.7.1) -- GDAL: NO
-- Video I/O: -- DC1394 1.x: NO -- DC1394 2.x: NO -- FFMPEG: NO -- codec: NO -- format: NO -- util: NO -- swscale: NO -- resample: NO -- gentoo-style: NO -- GStreamer: NO -- OpenNI: NO -- OpenNI PrimeSensor Modules: NO -- OpenNI2: NO -- PvAPI: NO -- GigEVisionSDK: NO -- UniCap: NO -- UniCap ucil: NO -- V4L/V4L2: NO/YES -- XIMEA: NO -- Xine: NO -- gPhoto2: NO
-- Other third-party libraries: -- Use IPP: 9.0.1 [9.0.1] -- at: /home/wanghs/opencv-3.1.0/3rdparty/ippicv/unpack/ippicv_lnx -- Use IPP Async: NO -- Use VA: NO -- Use Intel VA-API/OpenCL: NO -- Use Eigen: YES (ver 3.2.92) -- Use Cuda: NO -- Use OpenCL: YES -- Use custom HAL: NO
-- OpenCL: -- Version: dynamic -- Include path: /home/wanghs/opencv-3.1.0/3rdparty/include/opencl/1.2 -- Use AMDFFT: NO -- Use AMDBLAS: NO
-- Python 2: -- Interpreter: /usr/bin/python2.7 (ver 2.7.5) -- Libraries: /lib64/libpython2.7.so (ver 2.7.5) -- numpy: /usr/lib64/python2.7/site-packages/numpy/core/include (ver 1.7.1) -- packages path: lib/python2.7/site-packages
-- Java: -- ant: /bin/ant (ver 1.9.2) -- JNI: /usr/java/jdk1.8.0_51/include /usr/java/jdk1.8.0_51/include/linux /usr/java/jdk1.8.0_51/include -- Java wrappers: YES -- Java tests: YES
-- cvconfig.h is in: /home/wanghs/opencv-3.1.0/build
-- -- Configuring done -- Generating done -- Build files have been written to: /home/wanghs/opencv-3.1.0/build [wanghs@db2 build]$ make [ 5%] Built target libtiff [ 10%] Built target libwebp [ 12%] Built target libjasper [ 20%] Built target IlmImf [ 25%] Built target opencv_core [ 30%] Built target opencv_imgproc [ 32%] Built target opencv_imgcodecs [ 32%] Built target opencv_videoio [ 32%] Built target opencv_highgui [ 33%] Built target opencv_ts [ 35%] Built target opencv_perf_core [ 39%] Built target opencv_test_core [ 41%] Built target opencv_flann [ 41%] Built target opencv_test_flann [ 44%] Built target opencv_perf_imgproc [ 50%] Built target opencv_test_imgproc [ 51%] Built target opencv_ml [ 51%] Built target opencv_test_ml [ 52%] Built target opencv_photo [ 53%] Built target opencv_perf_photo [ 55%] Built target opencv_test_photo [ 56%] Built target opencv_video [ 57%] Built target opencv_perf_video [ 58%] Built target opencv_test_video [ 58%] Built target opencv_perf_imgcodecs [ 58%] Built target opencv_test_imgcodecs [ 58%] Built target opencv_shape [ 58%] Built target opencv_test_shape [ 58%] Built target opencv_perf_videoio [ 60%] Built target opencv_test_videoio [ 60%] Built target opencv_test_highgui [ 61%] Built target opencv_objdetect [ 61%] Built target opencv_perf_objdetect [ 61%] Built target opencv_test_objdetect [ 62%] Built target opencv_superres [ 62%] Built target opencv_perf_superres [ 62%] Built target opencv_test_superres [ 65%] Built target opencv_features2d [ 66%] Built target opencv_perf_features2d [ 67%] Built target opencv_test_features2d [ 70%] Built target opencv_calib3d [ 70%] Built target opencv_perf_calib3d [ 73%] Built target opencv_test_calib3d [ 74%] Built target opencv_videostab [ 75%] Built target opencv_stitching [ 75%] Generating src/org/opencv/core/Algorithm.java [ 75%] Generating src/org/opencv/core/Core.java [ 75%] Generating src/org/opencv/imgproc/Imgproc.java [ 75%] Generating src/org/opencv/imgproc/CLAHE.java [ 75%] Generating src/org/opencv/imgproc/Subdiv2D.java [ 76%] Generating src/org/opencv/imgproc/LineSegmentDetector.java [ 76%] Generating src/org/opencv/ml/Boost.java [ 76%] Generating src/org/opencv/ml/SVM.java [ 76%] Generating src/org/opencv/ml/LogisticRegression.java [ 76%] Generating src/org/opencv/ml/TrainData.java [ 76%] Generating src/org/opencv/ml/ANN_MLP.java [ 76%] Generating src/org/opencv/ml/Ml.java [ 76%] Generating src/org/opencv/ml/NormalBayesClassifier.java [ 76%] Generating src/org/opencv/ml/EM.java [ 76%] Generating src/org/opencv/ml/StatModel.java [ 76%] Generating src/org/opencv/ml/DTrees.java [ 76%] Generating src/org/opencv/ml/KNearest.java [ 76%] Generating src/org/opencv/ml/RTrees.java [ 78%] Generating src/org/opencv/photo/Tonemap.java [ 78%] Generating src/org/opencv/photo/MergeMertens.java [ 78%] Generating src/org/opencv/photo/CalibrateRobertson.java [ 78%] Generating src/org/opencv/photo/AlignExposures.java [ 78%] Generating src/org/opencv/photo/CalibrateDebevec.java [ 78%] Generating src/org/opencv/photo/MergeRobertson.java [ 78%] Generating src/org/opencv/photo/CalibrateCRF.java [ 78%] Generating src/org/opencv/photo/TonemapDrago.java [ 78%] Generating src/org/opencv/photo/MergeExposures.java [ 78%] Generating src/org/opencv/photo/TonemapDurand.java [ 78%] Generating src/org/opencv/photo/AlignMTB.java [ 78%] Generating src/org/opencv/photo/MergeDebevec.java [ 79%] Generating src/org/opencv/photo/TonemapMantiuk.java [ 79%] Generating src/org/opencv/photo/TonemapReinhard.java [ 79%] Generating src/org/opencv/photo/Photo.java [ 79%] Generating src/org/opencv/video/DenseOpticalFlow.java [ 79%] Generating src/org/opencv/video/Video.java [ 79%] Generating src/org/opencv/video/BackgroundSubtractorMOG2.java [ 79%] Generating src/org/opencv/video/BackgroundSubtractorKNN.java [ 79%] Generating src/org/opencv/video/DualTVL1OpticalFlow.java [ 79%] Generating src/org/opencv/video/BackgroundSubtractor.java [ 79%] Generating src/org/opencv/video/KalmanFilter.java [ 79%] Generating src/org/opencv/imgcodecs/Imgcodecs.java [ 79%] Generating src/org/opencv/videoio/Videoio.java [ 79%] Generating src/org/opencv/videoio/VideoCapture.java [ 80%] Generating src/org/opencv/videoio/VideoWriter.java [ 80%] Generating src/org/opencv/objdetect/BaseCascadeClassifier.java [ 80%] Generating src/org/opencv/objdetect/HOGDescriptor.java [ 80%] Generating src/org/opencv/objdetect/Objdetect.java [ 80%] Generating src/org/opencv/objdetect/CascadeClassifier.java [ 80%] Generating src/org/opencv/features2d/FeatureDetector.java [ 80%] Generating src/org/opencv/features2d/Features2d.java [ 80%] Generating src/org/opencv/features2d/DescriptorExtractor.java [ 80%] Generating src/org/opencv/features2d/DescriptorMatcher.java [ 80%] Generating src/org/opencv/calib3d/Calib3d.java [ 80%] Generating src/org/opencv/calib3d/StereoSGBM.java [ 80%] Generating src/org/opencv/calib3d/StereoBM.java [ 82%] Generating src/org/opencv/calib3d/StereoMatcher.java [ 82%] Generating src/org/opencv/utils/Converters.java [ 82%] Generating src/org/opencv/core/MatOfFloat.java [ 82%] Generating src/org/opencv/core/MatOfKeyPoint.java [ 82%] Generating src/org/opencv/core/Scalar.java [ 82%] Generating src/org/opencv/core/RotatedRect.java [ 82%] Generating src/org/opencv/core/MatOfDMatch.java [ 82%] Generating src/org/opencv/core/DMatch.java [ 82%] Generating src/org/opencv/core/MatOfRect.java [ 82%] Generating src/org/opencv/core/Mat.java [ 82%] Generating src/org/opencv/core/Rect.java [ 82%] Generating src/org/opencv/core/MatOfFloat6.java [ 82%] Generating src/org/opencv/core/MatOfInt.java [ 83%] Generating src/org/opencv/core/CvException.java [ 83%] Generating src/org/opencv/core/MatOfPoint2f.java [ 83%] Generating src/org/opencv/core/MatOfPoint.java [ 83%] Generating src/org/opencv/core/MatOfDouble.java [ 83%] Generating src/org/opencv/core/Point3.java [ 83%] Generating src/org/opencv/core/MatOfFloat4.java [ 83%] Generating src/org/opencv/core/MatOfPoint3.java [ 83%] Generating src/org/opencv/core/Size.java [ 83%] Generating src/org/opencv/core/Point.java [ 83%] Generating src/org/opencv/core/MatOfByte.java [ 83%] Generating src/org/opencv/core/CvType.java [ 83%] Generating src/org/opencv/core/Range.java [ 83%] Generating src/org/opencv/core/TermCriteria.java [ 84%] Generating src/org/opencv/core/KeyPoint.java [ 84%] Generating src/org/opencv/core/MatOfPoint3f.java [ 84%] Generating src/org/opencv/core/MatOfInt4.java [ 84%] Generating src/org/opencv/imgproc/Moments.java [ 84%] Generating opencv-310.jar
BUILD SUCCESSFUL Total time: 1 second [ 87%] Built target opencv_java [ 87%] Built target opencv_test_java_properties [ 87%] Copying the OpenCV jar [ 87%] Build Java tests Buildfile: /home/wanghs/opencv-3.1.0/build/modules/java/pure_test/.build/build.xml
build:
compile: [javac] Compiling 2 source files to /home/wanghs/opencv-3.1.0/build/modules/java/pure_test/.build/build/classes
jar: [jar] Building jar: /home/wanghs/opencv-3.1.0/build/modules/java/pure_test/.build/build/jar/opencv-test.jar
BUILD SUCCESSFUL Total time: 0 seconds [ 97%] Built target opencv_test_java [ 97%] Built target opencv_perf_stitching [ 98%] Built target opencv_test_stitching [ 98%] Generating pyopencv_generated_include.h, pyopencv_generated_funcs.h, pyopencv_generated_types.h, pyopencv_generated_type_reg.h, pyopencv_generated_ns_reg.h Scanning dependencies of target opencv_python2 [100%] Building CXX object modules/python2/CMakeFiles/opencv_python2.dir/__/src2/cv2.cpp.o Linking CXX shared module ../../lib/cv2.so [100%] Built target opencv_python2 [100%] Built target opencv_traincascade [100%] Built target opencv_createsamples [100%] Built target opencv_annotation [wanghs@db2 build]$ sudo make install [ 5%] Built target libtiff [ 10%] Built target libwebp [ 12%] Built target libjasper [ 20%] Built target IlmImf [ 25%] Built target opencv_core [ 30%] Built target opencv_imgproc [ 32%] Built target opencv_imgcodecs [ 32%] Built target opencv_videoio [ 32%] Built target opencv_highgui [ 33%] Built target opencv_ts [ 35%] Built target opencv_perf_core [ 39%] Built target opencv_test_core [ 41%] Built target opencv_flann [ 41%] Built target opencv_test_flann [ 44%] Built target opencv_perf_imgproc [ 50%] Built target opencv_test_imgproc [ 51%] Built target opencv_ml [ 51%] Built target opencv_test_ml [ 52%] Built target opencv_photo [ 53%] Built target opencv_perf_photo [ 55%] Built target opencv_test_photo [ 56%] Built target opencv_video [ 57%] Built target opencv_perf_video [ 58%] Built target opencv_test_video [ 58%] Built target opencv_perf_imgcodecs [ 58%] Built target opencv_test_imgcodecs [ 58%] Built target opencv_shape [ 58%] Built target opencv_test_shape [ 58%] Built target opencv_perf_videoio [ 60%] Built target opencv_test_videoio [ 60%] Built target opencv_test_highgui [ 61%] Built target opencv_objdetect [ 61%] Built target opencv_perf_objdetect [ 61%] Built target opencv_test_objdetect [ 62%] Built target opencv_superres [ 62%] Built target opencv_perf_superres [ 62%] Built target opencv_test_superres [ 65%] Built target opencv_features2d [ 66%] Built target opencv_perf_features2d [ 67%] Built target opencv_test_features2d [ 70%] Built target opencv_calib3d [ 70%] Built target opencv_perf_calib3d [ 73%] Built target opencv_test_calib3d [ 74%] Built target opencv_videostab [ 75%] Built target opencv_stitching [ 87%] Built target opencv_java [ 87%] Built target opencv_test_java_properties [ 97%] Built target opencv_test_java [ 97%] Built target opencv_perf_stitching [ 98%] Built target opencv_test_stitching [100%] Built target opencv_python2 [100%] Built target opencv_traincascade [100%] Built target opencv_createsamples [100%] Built target opencv_annotation Linking CXX shared module CMakeFiles/CMakeRelink.dir/cv2.so Install the project... -- Install configuration: "Release" -- Installing: /usr/local/share/OpenCV/3rdparty/lib/libippicv.a -- Installing: /usr/local/include/opencv2/cvconfig.h -- Installing: /usr/local/include/opencv2/opencv_modules.hpp -- Installing: /usr/local/lib/pkgconfig/opencv.pc -- Installing: /usr/local/share/OpenCV/OpenCVConfig.cmake -- Installing: /usr/local/share/OpenCV/OpenCVConfig-version.cmake -- Installing: /usr/local/share/OpenCV/OpenCVModules.cmake -- Installing: /usr/local/share/OpenCV/OpenCVModules-release.cmake -- Installing: /usr/local/share/OpenCV/3rdparty/lib/liblibtiff.a -- Installing: /usr/local/share/OpenCV/3rdparty/lib/liblibwebp.a -- Installing: /usr/local/share/OpenCV/3rdparty/lib/liblibjasper.a -- Installing: /usr/local/share/OpenCV/3rdparty/lib/libIlmImf.a -- Installing: /usr/local/include/opencv/highgui.h -- Installing: /usr/local/include/opencv/cxeigen.hpp -- Installing: /usr/local/include/opencv/cvaux.hpp -- Installing: /usr/local/include/opencv/cv.hpp -- Installing: /usr/local/include/opencv/cvaux.h -- Installing: /usr/local/include/opencv/cxcore.h -- Installing: /usr/local/include/opencv/cxcore.hpp -- Installing: /usr/local/include/opencv/cvwimage.h -- Installing: /usr/local/include/opencv/ml.h -- Installing: /usr/local/include/opencv/cxmisc.h -- Installing: /usr/local/include/opencv/cv.h -- Installing: /usr/local/include/opencv2/opencv.hpp -- Installing: /usr/local/lib/libopencv_core.a -- Installing: /usr/local/include/opencv2/core/cuda/funcattrib.hpp -- Installing: /usr/local/include/opencv2/core/cuda/border_interpolate.hpp -- Installing: /usr/local/include/opencv2/core/cuda/simd_functions.hpp -- Installing: /usr/local/include/opencv2/core/cuda/emulation.hpp -- Installing: /usr/local/include/opencv2/core/cuda/limits.hpp -- Installing: /usr/local/include/opencv2/core/cuda/block.hpp -- Installing: /usr/local/include/opencv2/core/cuda/functional.hpp -- Installing: /usr/local/include/opencv2/core/cuda/color.hpp -- Installing: /usr/local/include/opencv2/core/cuda/utility.hpp -- Installing: /usr/local/include/opencv2/core/cuda/scan.hpp -- Installing: /usr/local/include/opencv2/core/cuda/vec_traits.hpp -- Installing: /usr/local/include/opencv2/core/cuda/dynamic_smem.hpp -- Installing: /usr/local/include/opencv2/core/cuda/datamov_utils.hpp -- Installing: /usr/local/include/opencv2/core/cuda/vec_math.hpp -- Installing: /usr/local/include/opencv2/core/cuda/transform.hpp -- Installing: /usr/local/include/opencv2/core/cuda/type_traits.hpp -- Installing: /usr/local/include/opencv2/core/cuda/vec_distance.hpp -- Installing: /usr/local/include/opencv2/core/cuda/filters.hpp -- Installing: /usr/local/include/opencv2/core/cuda/common.hpp -- Installing: /usr/local/include/opencv2/core/cuda/warp.hpp -- Installing: /usr/local/include/opencv2/core/cuda/reduce.hpp -- Installing: /usr/local/include/opencv2/core/cuda/warp_shuffle.hpp -- Installing: /usr/local/include/opencv2/core/cuda/saturate_cast.hpp -- Installing: /usr/local/include/opencv2/core/cuda/warp_reduce.hpp -- Installing: /usr/local/include/opencv2/core/cuda/detail/vec_distance_detail.hpp -- Installing: /usr/local/include/opencv2/core/cuda/detail/transform_detail.hpp -- Installing: /usr/local/include/opencv2/core/cuda/detail/type_traits_detail.hpp -- Installing: /usr/local/include/opencv2/core/cuda/detail/reduce_key_val.hpp -- Installing: /usr/local/include/opencv2/core/cuda/detail/reduce.hpp -- Installing: /usr/local/include/opencv2/core/cuda/detail/color_detail.hpp -- Installing: /usr/local/include/opencv2/core.hpp -- Installing: /usr/local/include/opencv2/core/operations.hpp -- Installing: /usr/local/include/opencv2/core/private.cuda.hpp -- Installing: /usr/local/include/opencv2/core/cvstd.inl.hpp -- Installing: /usr/local/include/opencv2/core/mat.inl.hpp -- Installing: /usr/local/include/opencv2/core/version.hpp -- Installing: /usr/local/include/opencv2/core/ocl_genbase.hpp -- Installing: /usr/local/include/opencv2/core/cuda_stream_accessor.hpp -- Installing: /usr/local/include/opencv2/core/types.hpp -- Installing: /usr/local/include/opencv2/core/optim.hpp -- Installing: /usr/local/include/opencv2/core/persistence.hpp -- Installing: /usr/local/include/opencv2/core/ippasync.hpp -- Installing: /usr/local/include/opencv2/core/neon_utils.hpp -- Installing: /usr/local/include/opencv2/core/utility.hpp -- Installing: /usr/local/include/opencv2/core/private.hpp -- Installing: /usr/local/include/opencv2/core/bufferpool.hpp -- Installing: /usr/local/include/opencv2/core/matx.hpp -- Installing: /usr/local/include/opencv2/core/wimage.hpp -- Installing: /usr/local/include/opencv2/core/fast_math.hpp -- Installing: /usr/local/include/opencv2/core/cuda.hpp -- Installing: /usr/local/include/opencv2/core/directx.hpp -- Installing: /usr/local/include/opencv2/core/ptr.inl.hpp -- Installing: /usr/local/include/opencv2/core/eigen.hpp -- Installing: /usr/local/include/opencv2/core/traits.hpp -- Installing: /usr/local/include/opencv2/core/va_intel.hpp -- Installing: /usr/local/include/opencv2/core/saturate.hpp -- Installing: /usr/local/include/opencv2/core/opengl.hpp -- Installing: /usr/local/include/opencv2/core/cvstd.hpp -- Installing: /usr/local/include/opencv2/core/base.hpp -- Installing: /usr/local/include/opencv2/core/affine.hpp -- Installing: /usr/local/include/opencv2/core/cuda_types.hpp -- Installing: /usr/local/include/opencv2/core/sse_utils.hpp -- Installing: /usr/local/include/opencv2/core/core.hpp -- Installing: /usr/local/include/opencv2/core/mat.hpp -- Installing: /usr/local/include/opencv2/core/cuda.inl.hpp -- Installing: /usr/local/include/opencv2/core/ocl.hpp -- Installing: /usr/local/include/opencv2/core/core_c.h -- Installing: /usr/local/include/opencv2/core/cvdef.h -- Installing: /usr/local/include/opencv2/core/types_c.h -- Installing: /usr/local/include/opencv2/core/hal/intrin_cpp.hpp -- Installing: /usr/local/include/opencv2/core/hal/intrin_sse.hpp -- Installing: /usr/local/include/opencv2/core/hal/intrin.hpp -- Installing: /usr/local/include/opencv2/core/hal/hal.hpp -- Installing: /usr/local/include/opencv2/core/hal/intrin_neon.hpp -- Installing: /usr/local/include/opencv2/core/hal/interface.h -- Installing: /usr/local/lib/libopencv_flann.a -- Installing: /usr/local/include/opencv2/flann.hpp -- Installing: /usr/local/include/opencv2/flann/flann.hpp -- Installing: /usr/local/include/opencv2/flann/flann_base.hpp -- Installing: /usr/local/include/opencv2/flann/miniflann.hpp -- Installing: /usr/local/include/opencv2/flann/matrix.h -- Installing: /usr/local/include/opencv2/flann/sampling.h -- Installing: /usr/local/include/opencv2/flann/kdtree_single_index.h -- Installing: /usr/local/include/opencv2/flann/config.h -- Installing: /usr/local/include/opencv2/flann/kmeans_index.h -- Installing: /usr/local/include/opencv2/flann/result_set.h -- Installing: /usr/local/include/opencv2/flann/logger.h -- Installing: /usr/local/include/opencv2/flann/lsh_table.h -- Installing: /usr/local/include/opencv2/flann/dynamic_bitset.h -- Installing: /usr/local/include/opencv2/flann/nn_index.h -- Installing: /usr/local/include/opencv2/flann/params.h -- Installing: /usr/local/include/opencv2/flann/composite_index.h -- Installing: /usr/local/include/opencv2/flann/random.h -- Installing: /usr/local/include/opencv2/flann/ground_truth.h -- Installing: /usr/local/include/opencv2/flann/heap.h -- Installing: /usr/local/include/opencv2/flann/timer.h -- Installing: /usr/local/include/opencv2/flann/lsh_index.h -- Installing: /usr/local/include/opencv2/flann/index_testing.h -- Installing: /usr/local/include/opencv2/flann/hdf5.h -- Installing: /usr/local/include/opencv2/flann/general.h -- Installing: /usr/local/include/opencv2/flann/defines.h -- Installing: /usr/local/include/opencv2/flann/object_factory.h -- Installing: /usr/local/include/opencv2/flann/autotuned_index.h -- Installing: /usr/local/include/opencv2/flann/kdtree_index.h -- Installing: /usr/local/include/opencv2/flann/saving.h -- Installing: /usr/local/include/opencv2/flann/dist.h -- Installing: /usr/local/include/opencv2/flann/all_indices.h -- Installing: /usr/local/include/opencv2/flann/any.h -- Installing: /usr/local/include/opencv2/flann/simplex_downhill.h -- Installing: /usr/local/include/opencv2/flann/hierarchical_clustering_index.h -- Installing: /usr/local/include/opencv2/flann/allocator.h -- Installing: /usr/local/include/opencv2/flann/linear_index.h -- Installing: /usr/local/include/opencv2/flann/dummy.h -- Installing: /usr/local/lib/libopencv_imgproc.a -- Installing: /usr/local/include/opencv2/imgproc.hpp -- Installing: /usr/local/include/opencv2/imgproc/imgproc.hpp -- Installing: /usr/local/include/opencv2/imgproc/imgproc_c.h -- Installing: /usr/local/include/opencv2/imgproc/types_c.h -- Installing: /usr/local/include/opencv2/imgproc/detail/distortion_model.hpp -- Installing: /usr/local/lib/libopencv_ml.a -- Installing: /usr/local/include/opencv2/ml.hpp -- Installing: /usr/local/include/opencv2/ml/ml.hpp -- Installing: /usr/local/lib/libopencv_photo.a -- Installing: /usr/local/include/opencv2/photo.hpp -- Installing: /usr/local/include/opencv2/photo/cuda.hpp -- Installing: /usr/local/include/opencv2/photo/photo.hpp -- Installing: /usr/local/include/opencv2/photo/photo_c.h -- Installing: /usr/local/lib/libopencv_video.a -- Installing: /usr/local/include/opencv2/video.hpp -- Installing: /usr/local/include/opencv2/video/tracking.hpp -- Installing: /usr/local/include/opencv2/video/video.hpp -- Installing: /usr/local/include/opencv2/video/background_segm.hpp -- Installing: /usr/local/include/opencv2/video/tracking_c.h -- Installing: /usr/local/lib/libopencv_imgcodecs.a -- Installing: /usr/local/include/opencv2/imgcodecs.hpp -- Installing: /usr/local/include/opencv2/imgcodecs/imgcodecs.hpp -- Installing: /usr/local/include/opencv2/imgcodecs/imgcodecs_c.h -- Installing: /usr/local/include/opencv2/imgcodecs/ios.h -- Installing: /usr/local/lib/libopencv_shape.a -- Installing: /usr/local/include/opencv2/shape.hpp -- Installing: /usr/local/include/opencv2/shape/shape.hpp -- Installing: /usr/local/include/opencv2/shape/shape_distance.hpp -- Installing: /usr/local/include/opencv2/shape/shape_transformer.hpp -- Installing: /usr/local/include/opencv2/shape/emdL1.hpp -- Installing: /usr/local/include/opencv2/shape/hist_cost.hpp -- Installing: /usr/local/lib/libopencv_videoio.a -- Installing: /usr/local/include/opencv2/videoio.hpp -- Installing: /usr/local/include/opencv2/videoio/videoio.hpp -- Installing: /usr/local/include/opencv2/videoio/cap_ios.h -- Installing: /usr/local/include/opencv2/videoio/videoio_c.h -- Installing: /usr/local/lib/libopencv_highgui.a -- Installing: /usr/local/include/opencv2/highgui.hpp -- Installing: /usr/local/include/opencv2/highgui/highgui.hpp -- Installing: /usr/local/include/opencv2/highgui/highgui_c.h -- Installing: /usr/local/lib/libopencv_objdetect.a -- Installing: /usr/local/include/opencv2/objdetect.hpp -- Installing: /usr/local/include/opencv2/objdetect/detection_based_tracker.hpp -- Installing: /usr/local/include/opencv2/objdetect/objdetect.hpp -- Installing: /usr/local/include/opencv2/objdetect/objdetect_c.h -- Installing: /usr/local/lib/libopencv_superres.a -- Installing: /usr/local/include/opencv2/superres.hpp -- Installing: /usr/local/include/opencv2/superres/optical_flow.hpp -- Installing: /usr/local/lib/libopencv_ts.a -- Installing: /usr/local/lib/libopencv_features2d.a -- Installing: /usr/local/include/opencv2/features2d.hpp -- Installing: /usr/local/include/opencv2/features2d/features2d.hpp -- Installing: /usr/local/lib/libopencv_calib3d.a -- Installing: /usr/local/include/opencv2/calib3d.hpp -- Installing: /usr/local/include/opencv2/calib3d/calib3d.hpp -- Installing: /usr/local/include/opencv2/calib3d/calib3d_c.h -- Installing: /usr/local/share/OpenCV/java/opencv-310.jar -- Installing: /usr/local/share/OpenCV/java/libopencv_java310.so -- Installing: /usr/local/lib/libopencv_stitching.a -- Installing: /usr/local/include/opencv2/stitching.hpp -- Installing: /usr/local/include/opencv2/stitching/warpers.hpp -- Installing: /usr/local/include/opencv2/stitching/detail/seam_finders.hpp -- Installing: /usr/local/include/opencv2/stitching/detail/exposure_compensate.hpp -- Installing: /usr/local/include/opencv2/stitching/detail/autocalib.hpp -- Installing: /usr/local/include/opencv2/stitching/detail/warpers_inl.hpp -- Installing: /usr/local/include/opencv2/stitching/detail/blenders.hpp -- Installing: /usr/local/include/opencv2/stitching/detail/matchers.hpp -- Installing: /usr/local/include/opencv2/stitching/detail/util.hpp -- Installing: /usr/local/include/opencv2/stitching/detail/util_inl.hpp -- Installing: /usr/local/include/opencv2/stitching/detail/camera.hpp -- Installing: /usr/local/include/opencv2/stitching/detail/timelapsers.hpp -- Installing: /usr/local/include/opencv2/stitching/detail/motion_estimators.hpp -- Installing: /usr/local/include/opencv2/stitching/detail/warpers.hpp -- Installing: /usr/local/lib/libopencv_videostab.a -- Installing: /usr/local/include/opencv2/videostab.hpp -- Installing: /usr/local/include/opencv2/videostab/ring_buffer.hpp -- Installing: /usr/local/include/opencv2/videostab/inpainting.hpp -- Installing: /usr/local/include/opencv2/videostab/outlier_rejection.hpp -- Installing: /usr/local/include/opencv2/videostab/log.hpp -- Installing: /usr/local/include/opencv2/videostab/motion_stabilizing.hpp -- Installing: /usr/local/include/opencv2/videostab/motion_core.hpp -- Installing: /usr/local/include/opencv2/videostab/fast_marching_inl.hpp -- Installing: /usr/local/include/opencv2/videostab/deblurring.hpp -- Installing: /usr/local/include/opencv2/videostab/optical_flow.hpp -- Installing: /usr/local/include/opencv2/videostab/fast_marching.hpp -- Installing: /usr/local/include/opencv2/videostab/wobble_suppression.hpp -- Installing: /usr/local/include/opencv2/videostab/global_motion.hpp -- Installing: /usr/local/include/opencv2/videostab/stabilizer.hpp -- Installing: /usr/local/include/opencv2/videostab/frame_source.hpp -- Installing: /usr/local/lib/python2.7/site-packages/cv2.so -- Installing: /usr/local/share/OpenCV/haarcascades/haarcascade_lefteye_2splits.xml -- Installing: /usr/local/share/OpenCV/haarcascades/haarcascade_frontalface_alt.xml -- Installing: /usr/local/share/OpenCV/haarcascades/haarcascade_eye_tree_eyeglasses.xml -- Installing: /usr/local/share/OpenCV/haarcascades/haarcascade_smile.xml -- Installing: /usr/local/share/OpenCV/haarcascades/haarcascade_profileface.xml -- Installing: /usr/local/share/OpenCV/haarcascades/haarcascade_frontalface_alt_tree.xml -- Installing: /usr/local/share/OpenCV/haarcascades/haarcascade_frontalcatface_extended.xml -- Installing: /usr/local/share/OpenCV/haarcascades/haarcascade_russian_plate_number.xml -- Installing: /usr/local/share/OpenCV/haarcascades/haarcascade_fullbody.xml -- Installing: /usr/local/share/OpenCV/haarcascades/haarcascade_righteye_2splits.xml -- Installing: /usr/local/share/OpenCV/haarcascades/haarcascade_eye.xml -- Installing: /usr/local/share/OpenCV/haarcascades/haarcascade_frontalcatface.xml -- Installing: /usr/local/share/OpenCV/haarcascades/haarcascade_lowerbody.xml -- Installing: /usr/local/share/OpenCV/haarcascades/haarcascade_frontalface_alt2.xml -- Installing: /usr/local/share/OpenCV/haarcascades/haarcascade_licence_plate_rus_16stages.xml -- Installing: /usr/local/share/OpenCV/haarcascades/haarcascade_upperbody.xml -- Installing: /usr/local/share/OpenCV/haarcascades/haarcascade_frontalface_default.xml -- Installing: /usr/local/share/OpenCV/lbpcascades/lbpcascade_profileface.xml -- Installing: /usr/local/share/OpenCV/lbpcascades/lbpcascade_silverware.xml -- Installing: /usr/local/share/OpenCV/lbpcascades/lbpcascade_frontalface.xml -- Installing: /usr/local/share/OpenCV/lbpcascades/lbpcascade_frontalcatface.xml -- Installing: /usr/local/bin/opencv_traincascade -- Installing: /usr/local/bin/opencv_createsamples -- Installing: /usr/local/bin/opencv_annotation
Cat /etc/profile
export PKG_CONFIG_PATH=/usr/local/lib/pkgconfig:$PKG_CONFIG_PATH
export LD_LIBRARY_PATH=/usr/local/lib:$LD_LIBRARY_PATH
[wanghs@db2 mxnet]$ pkg-config --libs opencv -L/usr/local/lib -lopencv_calib3d -lopencv_core -lopencv_features2d -lopencv_flann -lopencv_highgui -lopencv_imgcodecs -lopencv_imgproc -lopencv_ml -lopencv_objdetect -lopencv_photo -lopencv_shape -lopencv_stitching -lopencv_superres -lopencv_video -lopencv_videoio -lopencv_videostab
[wanghs@db2 mxnet]$ cd example/warpctc/ [wanghs@db2 warpctc]$ python lstm lstm_ocr.py lstm.py [wanghs@db2 warpctc]$ python lstm_ocr.py Traceback (most recent call last): File "lstm_ocr.py", line 6, in import mxnet as mx File "../../python/mxnet/init.py", line 7, in from .base import MXNetError File "../../python/mxnet/base.py", line 43, in _LIB = _load_lib() File "../../python/mxnet/base.py", line 35, in _load_lib lib = ctypes.cdll.LoadLibrary(lib_path[0]) File "/usr/lib64/python2.7/ctypes/init.py", line 438, in LoadLibrary return self._dlltype(name) File "/usr/lib64/python2.7/ctypes/init.py", line 360, in init self._handle = _dlopen(self._name, mode) OSError: libopenblas.so.0: cannot open shared object file: No such file or directory
export LD_LIBRARY_PATH=/opt/OpenBLAS/lib/:$LD_LIBRARY_PATH
[wanghs@db2 warpctc]$ python lstm_ocr.py Traceback (most recent call last): File "lstm_ocr.py", line 6, in import mxnet as mx File "../../python/mxnet/init.py", line 7, in from .base import MXNetError File "../../python/mxnet/base.py", line 43, in _LIB = _load_lib() File "../../python/mxnet/base.py", line 35, in _load_lib lib = ctypes.cdll.LoadLibrary(lib_path[0]) File "/usr/lib64/python2.7/ctypes/init.py", line 438, in LoadLibrary return self._dlltype(name) File "/usr/lib64/python2.7/ctypes/init.py", line 360, in init self._handle = _dlopen(self._name, mode) OSError: libwarpctc.so: cannot open shared object file: No such file or directory
[wanghs@db2 warpctc]$ locate libwarpctc.so /home/wanghs/ocr/host-torch7/torch/install/lib/libwarpctc.so /home/wanghs/warp-ctc/build/libwarpctc.so [wanghs@db2 warpctc]$ export LD_LIBRARY_PATH=/home/wanghs/warp-ctc/build/:$LD_LIBRARY_PATH export LD_LIBRARY_PATH=/home/wanghs/ocr/host-torch7/torch/install/lib/:$LD_LIBRARY_PATH
[wanghs@db2 warpctc]$ python lstm_ocr.py Traceback (most recent call last): File "lstm_ocr.py", line 11, in from captcha.image import ImageCaptcha ImportError: No module named captcha.image
[wanghs@db2 warpctc]$ python lstm_ocr.py Traceback (most recent call last): File "lstm_ocr.py", line 12, in import cv2, random ImportError: No module named cv2 [wanghs@db2 warpctc]$ python -V Python 2.7.5 [wanghs@db2 warpctc]$ ls /usr/local/lib/python2.7/ site-packages [wanghs@db2 warpctc]$ vim lstm_ocr.py [wanghs@db2 warpctc]$ python lstm_ocr.py begin fit 2016-09-22 14:24:05,083 Start training with [gpu(1)] [14:24:05] /home/wanghs/ocr/mxnet-wanghaisheng/dmlc-core/include/dmlc/./logging.h:235: [14:24:05] src/storage/storage.cc:50: Please compile with CUDA enabled Traceback (most recent call last): File "lstm_ocr.py", line 175, in batch_end_callback=mx.callback.Speedometer(BATCH_SIZE, 50),) File "../../python/mxnet/model.py", line 785, in fit sym_gen=self.sym_gen) File "../../python/mxnet/model.py", line 188, in _train_multi_device logger=logger) File "../../python/mxnet/executor_manager.py", line 311, in init self.slices, train_data) File "../../python/mxnet/executor_manager.py", line 224, in init shared_data_arrays=self.shared_data_arrays[i]) File "../../python/mxnet/executor_manager.py", line 145, in _bind_exec arg_arr = nd.zeros(arg_shape[i], ctx, dtype=arg_types[i]) File "../../python/mxnet/ndarray.py", line 842, in zeros arr = empty(shape, ctx, dtype) File "../../python/mxnet/ndarray.py", line 578, in empty return NDArray(handle=_new_alloc_handle(shape, ctx, False, dtype)) File "../../python/mxnet/ndarray.py", line 69, in _new_alloc_handle ctypes.byref(hdl))) File "../../python/mxnet/base.py", line 77, in check_call raise MXNetError(py_str(_LIB.MXGetLastError())) mxnet.base.MXNetError: [14:24:05] src/storage/storage.cc:50: Please compile with CUDA enabled
修改 [wanghs@db2 warpctc]$ vim lstm_ocr.py 增加 sys.path.append('/usr/local/lib/python2.7/site-packages') 即可