Tencent / TNN

TNN: developed by Tencent Youtu Lab and Guangying Lab, a uniform deep learning inference framework for mobile、desktop and server. TNN is distinguished by several outstanding features, including its cross-platform capability, high performance, model compression and code pruning. Based on ncnn and Rapidnet, TNN further strengthens the support and performance optimization for mobile devices, and also draws on the advantages of good extensibility and high performance from existed open source efforts. TNN has been deployed in multiple Apps from Tencent, such as Mobile QQ, Weishi, Pitu, etc. Contributions are welcome to work in collaborative with us and make TNN a better framework.
Other
4.41k stars 771 forks source link

linux编译出错 #750

Closed chenloveheimei closed 3 years ago

chenloveheimei commented 3 years ago

1. 环境(environment)

seanxcwang commented 3 years ago

你要运行在arm上,为什么会用x86的编译脚本

chenloveheimei commented 3 years ago

你要运行在arm上,为什么会用x86的编译脚本

1.scripts编译是否正确 long@long-Ubuntu:~/soft/TNN/scripts$ ls build32 build_cuda_linux.sh build_msvc.bat build64 build_ios.sh build_msvc_naive.bat build_aarch64_linux build_linux build_test.sh build_aarch64_linux.sh build_linux_naive.sh linux_release build_aarch64_macos.sh build_linux.sh release build_android.sh build_macos_naive.sh version build_armhf_linux.sh build_macos.sh long@long-Ubuntu:~/soft/TNN/scripts$ ./build_aarch64_linux.sh 编译这个是否正确?

你们编译文档里面写./build_arm_linux.sh编译这个,但是scripts里面没有这个,你们也没有更新说明文档.

2.example编译是否正确 long@long-Ubuntu:~/soft/TNN/examples$ ls android assets base cuda ios linux README.md utils x86 long@long-Ubuntu:~/soft/TNN/examples/linux$ ls build_aarch64_linux.sh build_linux.sh Readme.md build_armhf_linux.sh CMakeLists.txt src 选择linux编译吗?选择哪个编译?

seanxcwang commented 3 years ago

64位就用build_aarch64_linux.sh,32位用build_armhf_linux.sh

chenloveheimei commented 3 years ago

64位就用build_aarch64_linux.sh,32位用build_armhf_linux.sh

long@long-Ubuntu:~/soft/TNN/examples/linux$ ./build_aarch64_linux.sh mkdir: 无法创建目录"build_aarch64_linux": 文件已存在 /home/long/soft/TNN /home/long/soft/TNN -- >>>>>>>>>>>>> -- TNN BUILD INFO: -- System: Linux -- Processor: aarch64 -- Cpu: OFF -- X86: OFF -- Arm: ON -- Arm82: OFF -- Metal: OFF -- OpenCL: OFF -- CUDA: OFF -- DSP: OFF -- Atlas: OFF -- TensorRT: OFF -- HuaweiNPU: OFF -- RKNPU: OFF -- OpenVINO: OFF -- OpenMP: ON -- TEST: ON -- --Unit Test: OFF -- Qantization: OFF -- ModelCheck: OFF -- DEBUG:
-- PROFILE: OFF -- BENCHMARK: OFF -- BENCHMARK Layer: OFF -- Model Converter: OFF -- TNN2MEM: OFF -- BENCHMARK Test Lib: OFF -- Configuring done -- Generating done -- Build files have been written to: /home/long/soft/TNN/scripts/build_aarch64_linux [ 2%] Built target gflags_nothreads_static [ 31%] Built target TNNArm [ 99%] Built target TNN [100%] Built target TNNTest /home/long/soft/TNN/examples/linux rm: 无法删除'build': 没有那个文件或目录 -- The C compiler identification is GNU 7.5.0 -- The CXX compiler identification is GNU 7.5.0 -- Detecting C compiler ABI info -- Detecting C compiler ABI info - done -- Check for working C compiler: /usr/bin/aarch64-linux-gnu-gcc - skipped -- Detecting C compile features -- Detecting C compile features - done -- Detecting CXX compiler ABI info -- Detecting CXX compiler ABI info - done -- Check for working CXX compiler: /usr/bin/aarch64-linux-gnu-g++ - skipped -- Detecting CXX compile features -- Detecting CXX compile features - done /home/long/soft/TNN/examples/linux ../../scripts/build_aarch64_linux/ -- Configuring done -- Generating done -- Build files have been written to: /home/long/soft/TNN/examples/linux/build Scanning dependencies of target demo_arm_linux_imageclassify Scanning dependencies of target demo_arm_linux_facedetector [ 2%] Building CXX object CMakeFiles/demo_arm_linux_facedetector.dir/src/face_detector.cc.o [ 4%] Building CXX object CMakeFiles/demo_arm_linux_facedetector.dir/home/long/soft/TNN/examples/base/blazeface_detector.cc.o [ 7%] Building CXX object CMakeFiles/demo_arm_linux_facedetector.dir/home/long/soft/TNN/examples/base/blazepose_detector.cc.o [ 9%] Building CXX object CMakeFiles/demo_arm_linux_imageclassify.dir/src/image_classify.cc.o [ 11%] Building CXX object CMakeFiles/demo_arm_linux_facedetector.dir/home/long/soft/TNN/examples/base/blazepose_landmark.cc.o [ 14%] Building CXX object CMakeFiles/demo_arm_linux_facedetector.dir/home/long/soft/TNN/examples/base/face_detect_aligner.cc.o [ 16%] Building CXX object CMakeFiles/demo_arm_linux_imageclassify.dir/home/long/soft/TNN/examples/base/blazeface_detector.cc.o [ 19%] Building CXX object CMakeFiles/demo_arm_linux_facedetector.dir/home/long/soft/TNN/examples/base/face_detect_mesh.cc.o [ 21%] Building CXX object CMakeFiles/demo_arm_linux_imageclassify.dir/home/long/soft/TNN/examples/base/blazepose_detector.cc.o [ 23%] Building CXX object CMakeFiles/demo_arm_linux_facedetector.dir/home/long/soft/TNN/examples/base/face_gray_transfer.cc.o [ 26%] Building CXX object CMakeFiles/demo_arm_linux_facedetector.dir/home/long/soft/TNN/examples/base/face_mesh.cc.o [ 28%] Building CXX object CMakeFiles/demo_arm_linux_imageclassify.dir/home/long/soft/TNN/examples/base/blazepose_landmark.cc.o [ 30%] Building CXX object CMakeFiles/demo_arm_linux_imageclassify.dir/home/long/soft/TNN/examples/base/face_detect_aligner.cc.o [ 33%] Building CXX object CMakeFiles/demo_arm_linux_imageclassify.dir/home/long/soft/TNN/examples/base/face_detect_mesh.cc.o [ 35%] Building CXX object CMakeFiles/demo_arm_linux_facedetector.dir/home/long/soft/TNN/examples/base/hair_segmentation.cc.o [ 38%] Building CXX object CMakeFiles/demo_arm_linux_imageclassify.dir/home/long/soft/TNN/examples/base/face_gray_transfer.cc.o [ 40%] Building CXX object CMakeFiles/demo_arm_linux_imageclassify.dir/home/long/soft/TNN/examples/base/face_mesh.cc.o [ 42%] Building CXX object CMakeFiles/demo_arm_linux_facedetector.dir/home/long/soft/TNN/examples/base/image_classifier.cc.o [ 45%] Building CXX object CMakeFiles/demo_arm_linux_imageclassify.dir/home/long/soft/TNN/examples/base/hair_segmentation.cc.o [ 47%] Building CXX object CMakeFiles/demo_arm_linux_imageclassify.dir/home/long/soft/TNN/examples/base/image_classifier.cc.o [ 50%] Building CXX object CMakeFiles/demo_arm_linux_facedetector.dir/home/long/soft/TNN/examples/base/object_detector_ssd.cc.o [ 52%] Building CXX object CMakeFiles/demo_arm_linux_imageclassify.dir/home/long/soft/TNN/examples/base/object_detector_ssd.cc.o [ 54%] Building CXX object CMakeFiles/demo_arm_linux_facedetector.dir/home/long/soft/TNN/examples/base/object_detector_yolo.cc.o [ 57%] Building CXX object CMakeFiles/demo_arm_linux_facedetector.dir/home/long/soft/TNN/examples/base/pose_detect_landmark.cc.o [ 59%] Building CXX object CMakeFiles/demo_arm_linux_facedetector.dir/home/long/soft/TNN/examples/base/sample_timer.cc.o [ 61%] Building CXX object CMakeFiles/demo_arm_linux_imageclassify.dir/home/long/soft/TNN/examples/base/object_detector_yolo.cc.o [ 64%] Building CXX object CMakeFiles/demo_arm_linux_facedetector.dir/home/long/soft/TNN/examples/base/skeleton_detector.cc.o [ 66%] Building CXX object CMakeFiles/demo_arm_linux_facedetector.dir/home/long/soft/TNN/examples/base/tnn_fps_counter.cc.o [ 69%] Building CXX object CMakeFiles/demo_arm_linux_facedetector.dir/home/long/soft/TNN/examples/base/tnn_sdk_sample.cc.o [ 71%] Building CXX object CMakeFiles/demo_arm_linux_facedetector.dir/home/long/soft/TNN/examples/base/ultra_face_detector.cc.o [ 73%] Building CXX object CMakeFiles/demo_arm_linux_imageclassify.dir/home/long/soft/TNN/examples/base/pose_detect_landmark.cc.o [ 76%] Building CXX object CMakeFiles/demo_arm_linux_facedetector.dir/home/long/soft/TNN/examples/base/utils/utils.cc.o [ 78%] Building CXX object CMakeFiles/demo_arm_linux_imageclassify.dir/home/long/soft/TNN/examples/base/sample_timer.cc.o [ 80%] Building CXX object CMakeFiles/demo_arm_linux_imageclassify.dir/home/long/soft/TNN/examples/base/skeleton_detector.cc.o [ 83%] Building CXX object CMakeFiles/demo_arm_linux_imageclassify.dir/home/long/soft/TNN/examples/base/tnn_fps_counter.cc.o [ 85%] Building CXX object CMakeFiles/demo_arm_linux_facedetector.dir/home/long/soft/TNN/examples/base/youtu_face_align.cc.o [ 88%] Building CXX object CMakeFiles/demo_arm_linux_imageclassify.dir/home/long/soft/TNN/examples/base/tnn_sdk_sample.cc.o [ 90%] Building CXX object CMakeFiles/demo_arm_linux_imageclassify.dir/home/long/soft/TNN/examples/base/ultra_face_detector.cc.o [ 92%] Building CXX object CMakeFiles/demo_arm_linux_imageclassify.dir/home/long/soft/TNN/examples/base/utils/utils.cc.o [ 95%] Building CXX object CMakeFiles/demo_arm_linux_imageclassify.dir/home/long/soft/TNN/examples/base/youtu_face_align.cc.o [ 97%] Linking CXX executable demo_arm_linux_facedetector CMakeFiles/demo_arm_linux_facedetector.dir/home/long/soft/TNN/examples/base/blazepose_landmark.cc.o:在函数‘tnn::BlazePoseLandmark::SmoothingLandmarks(std::vector<tnn::ObjectInfo, std::allocator >&)’中: blazepose_landmark.cc:(.text+0x6ac):对‘tnn::Now()’未定义的引用 blazepose_landmark.cc:(.text+0x6d8):对‘tnn::VelocityFilter::Apply(std::vector<std::tuple<float, float, float>, std::allocator<std::tuple<float, float, float> > > const&, std::pair<int, int> const&, std::chrono::time_point<std::chrono::_V2::system_clock, std::chrono::duration<long, std::ratio<1l, 1000000000l> > > const&, std::vector<std::tuple<float, float, float>, std::allocator<std::tuple<float, float, float> > >)’未定义的引用 CMakeFiles/demo_arm_linux_facedetector.dir/home/long/soft/TNN/examples/base/skeleton_detector.cc.o:在函数‘tnn::SkeletonDetector::SmoothingLandmarks(tnn::SkeletonDetectorOutput)’中: skeleton_detector.cc:(.text+0x3b4):对‘tnn::Now()’未定义的引用 skeleton_detector.cc:(.text+0x3dc):对‘tnn::VelocityFilter::Apply2D(std::vector<std::pair<float, float>, std::allocator<std::pair<float, float> > > const&, std::pair<int, int> const&, std::chrono::time_point<std::chrono::_V2::system_clock, std::chrono::duration<long, std::ratio<1l, 1000000000l> > > const&, std::vector<std::pair<float, float>, std::allocator<std::pair<float, float> > >*)’未定义的引用 collect2: error: ld returned 1 exit status CMakeFiles/demo_arm_linux_facedetector.dir/build.make:387: recipe for target 'demo_arm_linux_facedetector' failed make[2]: [demo_arm_linux_facedetector] Error 1 CMakeFiles/Makefile2:123: recipe for target 'CMakeFiles/demo_arm_linux_facedetector.dir/all' failed make[1]: [CMakeFiles/demo_arm_linux_facedetector.dir/all] Error 2 make[1]: 正在等待未完成的任务.... [100%] Linking CXX executable demo_arm_linux_imageclassify CMakeFiles/demo_arm_linux_imageclassify.dir/home/long/soft/TNN/examples/base/blazepose_landmark.cc.o:在函数‘tnn::BlazePoseLandmark::SmoothingLandmarks(std::vector<tnn::ObjectInfo, std::allocator >&)’中: blazepose_landmark.cc:(.text+0x6ac):对‘tnn::Now()’未定义的引用 blazepose_landmark.cc:(.text+0x6d8):对‘tnn::VelocityFilter::Apply(std::vector<std::tuple<float, float, float>, std::allocator<std::tuple<float, float, float> > > const&, std::pair<int, int> const&, std::chrono::time_point<std::chrono::_V2::system_clock, std::chrono::duration<long, std::ratio<1l, 1000000000l> > > const&, std::vector<std::tuple<float, float, float>, std::allocator<std::tuple<float, float, float> > >)’未定义的引用 CMakeFiles/demo_arm_linux_imageclassify.dir/home/long/soft/TNN/examples/base/skeleton_detector.cc.o:在函数‘tnn::SkeletonDetector::SmoothingLandmarks(tnn::SkeletonDetectorOutput)’中: skeleton_detector.cc:(.text+0x3b4):对‘tnn::Now()’未定义的引用 skeleton_detector.cc:(.text+0x3dc):对‘tnn::VelocityFilter::Apply2D(std::vector<std::pair<float, float>, std::allocator<std::pair<float, float> > > const&, std::pair<int, int> const&, std::chrono::time_point<std::chrono::_V2::system_clock, std::chrono::duration<long, std::ratio<1l, 1000000000l> > > const&, std::vector<std::pair<float, float>, std::allocator<std::pair<float, float> > >)’未定义的引用 collect2: error: ld returned 1 exit status CMakeFiles/demo_arm_linux_imageclassify.dir/build.make:387: recipe for target 'demo_arm_linux_imageclassify' failed make[2]: ** [demo_arm_linux_imageclassify] Error 1 CMakeFiles/Makefile2:96: recipe for target 'CMakeFiles/demo_arm_linux_imageclassify.dir/all' failed make[1]: [CMakeFiles/demo_arm_linux_imageclassify.dir/all] Error 2 Makefile:102: recipe for target 'all' failed make: *** [all] Error 2

Czhazha commented 3 years ago

在x86 linux上使用build_linux.sh是会报找不到openvino的库 我更改了一下相关路径就可以运行了

TNN_OPENVINO_LIB_PATH=../../source/tnn/network/openvino/thirdparty/openvino/lib

TNN_OPENVINO_LIB_PATH=../../scripts/linux_release/lib