PaddlePaddle / PaddleOCR

Awesome multilingual OCR toolkits based on PaddlePaddle (practical ultra lightweight OCR system, support 80+ languages recognition, provide data annotation and synthesis tools, support training and deployment among server, mobile, embedded and IoT devices)
https://paddlepaddle.github.io/PaddleOCR/
Apache License 2.0
44.47k stars 7.84k forks source link

why i cna't found libmkldnn.so.0 in the paddle_inference #13842

Closed hans-bbt closed 2 months ago

hans-bbt commented 2 months ago

🔎 Search before asking

🐛 Bug (问题描述)

why cmakelists add the third_party/install/onednn/lib/libmkldnn.so.0 to the project,but i can't found libmkldnn.so.0 , only have libdnnl.so.3 in this folder, when complier the cpp_infer

🏃‍♂️ Environment (运行环境)

kylin v12, cpu, mkl paddle_inferenc

🌰 Minimal Reproducible Example (最小可复现问题的Demo)

-- The CXX compiler identification is GNU 9.3.0 -- The C compiler identification is GNU 9.3.0 -- Check for working CXX compiler: /usr/bin/c++ -- Check for working CXX compiler: /usr/bin/c++ -- works -- Detecting CXX compiler ABI info -- Detecting CXX compiler ABI info - done -- Detecting CXX compile features -- Detecting CXX compile features - done -- Check for working C compiler: /usr/bin/cc -- Check for working C compiler: /usr/bin/cc -- works -- Detecting C compiler ABI info -- Detecting C compiler ABI info - done -- Detecting C compile features -- Detecting C compile features - done -- Found OpenCV: /usr/local (found version "3.4.7") cmake cxx flags -g -o3 -fopenmp -std=c++11 -- Found Git: /usr/bin/git (found version "2.25.1") default cmake for auto_log, no need to compile -- Configuring done -- Generating done -- Build files have been written to: /home/hbt/PaddleOCR-main/deploy/cpp_infer/build Scanning dependencies of target ppocr [ 7%] Building CXX object CMakeFiles/ppocr.dir/src/clipper.cpp.o [ 14%] Building CXX object CMakeFiles/ppocr.dir/src/args.cpp.o [ 28%] Building CXX object CMakeFiles/ppocr.dir/src/paddlestructure.cpp.o [ 28%] Building CXX object CMakeFiles/ppocr.dir/src/paddleocr.cpp.o [ 35%] Building CXX object CMakeFiles/ppocr.dir/src/ocr_det.cpp.o [ 42%] Building CXX object CMakeFiles/ppocr.dir/src/main.cpp.o [ 50%] Building CXX object CMakeFiles/ppocr.dir/src/ocr_rec.cpp.o [ 57%] Building CXX object CMakeFiles/ppocr.dir/src/ocr_cls.cpp.o [ 64%] Building CXX object CMakeFiles/ppocr.dir/src/postprocess_op.cpp.o [ 71%] Building CXX object CMakeFiles/ppocr.dir/src/preprocess_op.cpp.o [ 78%] Building CXX object CMakeFiles/ppocr.dir/src/structure_layout.cpp.o [ 85%] Building CXX object CMakeFiles/ppocr.dir/src/structure_table.cpp.o make[2]: 没有规则可制作目标“/home/hbt/paddle_inference/third_party/install/onednn/lib/libmkldnn.so.0”,由“ppocr” 需求。 停止。 make[2]: 正在等待未完成的任务.... [ 92%] Building CXX object CMakeFiles/ppocr.dir/src/utility.cpp.o make[1]: [CMakeFiles/Makefile2:96:CMakeFiles/ppocr.dir/all] 错误 2 make: [Makefile:84:all] 错误 2

hans-bbt commented 2 months ago

where is the libmkldnn.so.0? paddle_inference 2.6 only has libmkldnn.so.3

GreatV commented 2 months ago

Since the tutorial has not been updated, you may need to change it yourself based on the new version of the paddle_inference library. For example modify cmakelists.txt

https://github.com/PaddlePaddle/PaddleOCR/blob/5b54ac460623d7dd23717e39b43b182a359bd606/deploy/cpp_infer/CMakeLists.txt#L136

hans-bbt commented 2 months ago

Since the tutorial has not been updated, you may need to change it yourself based on the new version of the paddle_inference library. For example modify cmakelists.txt

https://github.com/PaddlePaddle/PaddleOCR/blob/5b54ac460623d7dd23717e39b43b182a359bd606/deploy/cpp_infer/CMakeLists.txt#L136

是的 我是这样修改的 但是他依然提示这个错误 终端错误信息: -- The CXX compiler identification is GNU 8.4.0 -- The C compiler identification is GNU 8.4.0 -- Check for working CXX compiler: /usr/bin/c++ -- Check for working CXX compiler: /usr/bin/c++ -- works -- Detecting CXX compiler ABI info -- Detecting CXX compiler ABI info - done -- Detecting CXX compile features -- Detecting CXX compile features - done -- Check for working C compiler: /usr/bin/cc -- Check for working C compiler: /usr/bin/cc -- works -- Detecting C compiler ABI info -- Detecting C compiler ABI info - done -- Detecting C compile features -- Detecting C compile features - done -- Found OpenCV: /usr/local (found version "3.4.7") cmake cxx flags -g -o3 -fopenmp -std=c++11 -- Found Git: /usr/bin/git (found version "2.25.1") default cmake for auto_log, no need to compile -- Configuring done -- Generating done -- Build files have been written to: /home/hbt/PaddleOCR-release-2.6/deploy/cpp_infer/build Scanning dependencies of target ppocr make[2]: 没有规则可制作目标“/home/hbt/paddle_inference/third_party/install/mkldnn/lib/libmkldnn.so.3”,由“ppocr” 需求。 停止。 make[2]: 正在等待未完成的任务.... [ 7%] Building CXX object CMakeFiles/ppocr.dir/src/clipper.cpp.o [ 21%] Building CXX object CMakeFiles/ppocr.dir/src/ocr_rec.cpp.o [ 21%] Building CXX object CMakeFiles/ppocr.dir/src/postprocess_op.cpp.o [ 28%] Building CXX object CMakeFiles/ppocr.dir/src/ocr_det.cpp.o [ 35%] Building CXX object CMakeFiles/ppocr.dir/src/main.cpp.o [ 42%] Building CXX object CMakeFiles/ppocr.dir/src/args.cpp.o [ 57%] Building CXX object CMakeFiles/ppocr.dir/src/paddleocr.cpp.o [ 57%] Building CXX object CMakeFiles/ppocr.dir/src/ocr_cls.cpp.o [ 64%] Building CXX object CMakeFiles/ppocr.dir/src/paddlestructure.cpp.o [ 71%] Building CXX object CMakeFiles/ppocr.dir/src/structure_table.cpp.o [ 78%] Building CXX object CMakeFiles/ppocr.dir/src/structure_layout.cpp.o [ 85%] Building CXX object CMakeFiles/ppocr.dir/src/preprocess_op.cpp.o [ 92%] Building CXX object CMakeFiles/ppocr.dir/src/utility.cpp.o make[1]: [CMakeFiles/Makefile2:96:CMakeFiles/ppocr.dir/all] 错误 2 make: [Makefile:84:all] 错误 2 cmakelists中的修改: set(MKLDNN_LIB ${MKLDNN_PATH}/lib/libmkldnn.so.3) 我使用的paddleocr版本是2.6 paddle_inference版本是2.6 cpu mkl 请问能否提供给我一个相互匹配的paddleocr与paddle_inference

GreatV commented 2 months ago

注意一下名称变了 image

Cupcc commented 3 weeks ago

注意一下名称变了 image

编译PaddleOCR C++预测demo时

/usr/bin/ld: warning: libdnnl.so.3, needed by /home/to/deploy/paddle_inference/paddle/lib/libpaddle_inference.so, not found (try using -rpath or -rpath-link)

paddle_inference/third_party/install/mkldnn/lib/ 这里面没有libdnnl.so.3 ,如何修改?按照教程使用的下载paddle C++预测库,下载的第一行推理库CPU MKL 3.0.0beta1 image