LiuLimingCode / HFNet_SLAM

HFNet-SLAM: An accurate and real-time monocular SLAM system with deep features
89 stars 15 forks source link

How should I compile? #5

Closed Battlefieldgoblin closed 1 year ago

Battlefieldgoblin commented 1 year ago

Thank you very much for your open-source code, but after a week of compilation, I found that the code did not compile successfully on Ubuntu 20. The following is a description of the problem I encountered. My English is not very good, please forgive me.

For TensorRT version: I also encountered the problem of problem 4, My output is the same as that of LiuLimingCode. but the bugs I encountered are the same as OthmanLoutfi. It seems that there is a problem with gcc and g++version. Does this code use the default gcc version?

For TensorFlow_ CC version: I also tried using the TensorFlow version, but encountered an issue with changing the eigen address on TensorFlow_cc 1.15. See TensorFlow_CC solution does not effectively address the issue..

I have been compiling TensorFlow_cc 2.0 for a long time but it has been very smooth. Specifically, creating and building builds, then cmake and make, but I found that this directory is not as standardized as cmakelist in the code that needs to be modified. Specifically, the directory here is different from mine:

Set (Tensorflow_Root "~/src/Tensorflow_cc-2.9.0/Tensorflow_cc/install") Set (Tensorflow_INCLUDE-DIRS Tensorflow Root}/include/Tensorflow/bezel bin/Tensorflow/include Tensorflow Root}/include/Tensorflow/bezel bin/Tensorflow/include/src) Set (Tensorflow_LIBS TensorflowRoot}/lib/libtensorflow Cc.so TensorflowRoot}/lib/libtensorflow Framework. so)

There are many differences between this directory structure and the directory I compiled, which makes it completely impossible for me to replace it with my own directory.I even found that my code query did not include libtensorflow_ Framework.so file. May I have a problem compiling TensorFlow_cc?

I did not try the third compilation method because you said it had poor performance.

So, how should I compile?

Battlefieldgoblin commented 1 year ago

目前我已经可以编译了,他的编译结果如下: ./build.sh Configuring and building Thirdparty/g2o ... mkdir: 无法创建目录 “build”: 文件已存在 CMake Error: The current CMakeCache.txt directory /home/yu/ubuntu20/tf_docker/HFNet_SLAM-_docker/HFNet_SLAM-main/Thirdparty/g2o/build/CMakeCache.txt is different than the directory /shared_volume/HFNet_SLAM-main/Thirdparty/g2o/build where CMakeCache.txt was created. This may result in binaries being created in the wrong place. If you are not sure, reedit the CMakeCache.txt CMake Error: The source "/home/yu/ubuntu20/tf_docker/HFNet_SLAM-_docker/HFNet_SLAM-main/Thirdparty/g2o/CMakeLists.txt" does not match the source "/shared_volume/HFNet_SLAM-main/Thirdparty/g2o/CMakeLists.txt" used to generate cache. Re-run cmake with a different source directory. CMake Error: The source directory "/shared_volume/HFNet_SLAM-main/Thirdparty/g2o" does not exist. Specify --help for usage, or press the help button on the CMake GUI. make: *** [Makefile:1046:cmake_check_build_system] 错误 1 Configuring and building Thirdparty/Sophus ... mkdir: 无法创建目录 “build”: 文件已存在 -- Configuring done -- Generating done -- Build files have been written to: /home/yu/ubuntu20/tf_docker/HFNet_SLAM-_docker/HFNet_SLAM-main/Thirdparty/Sophus/build [ 8%] Built target test_common [ 29%] Built target test_rxso2 [ 33%] Built target test_geometry [ 33%] Built target test_so2 [ 45%] Built target test_velocities [ 50%] Built target test_sim2 [ 58%] Built target test_se2 [ 66%] Built target test_sim3 [ 91%] Built target HelloSO3 [ 91%] Built target test_so3 [ 91%] Built target test_se3 [100%] Built target test_rxso3 Configuring and building ORB_SLAM3 ... mkdir: 无法创建目录 “build”: 文件已存在 build type: Release -- Configuring done -- Generating done -- Build files have been written to: /home/yu/ubuntu20/tf_docker/HFNet_SLAM-_docker/HFNet_SLAM-main/build [ 62%] Built target HFNet_SLAM [ 70%] Built target rgbd_tum [ 70%] Built target test_match_local_feats [ 74%] Built target mono_tum_vi [ 77%] Built target test_extractors [ 81%] Built target mono_inertial_euroc [ 85%] Built target mono_inertial_tum_vi [ 88%] Built target test_match_global_feats [ 92%] Built target mono_euroc [ 96%] Built target test_hfnet_tf_v1 [100%] Built target test_hfnet_tf_v2

但是编译成功运行代码的时候却保错 ./Examples/Monocular/mono_euroc ./Examples/Monocular/EuRoC.yaml ./evaluation/EUROC/ /home/yu/EUROC/MH_01_easy/ ./Examples/Monocular/EuRoC_TimeStamps/MH01.txt 2023-07-12 08:42:11.289169: I tensorflow/core/util/util.cc:169] oneDNN custom operations are on. You may see slightly different numerical results due to floating-point round-off errors from different computation orders. To turn them off, set the environment variable TF_ENABLE_ONEDNN_OPTS=0. num_seq = 1 settings path: ./Examples/Monocular/EuRoC.yaml result save path: ./evaluation/EUROC/ Loading images for sequence 0...LOADED!


ORB-SLAM3 Copyright (C) 2017-2020 Carlos Campos, Richard Elvira, Juan J. Gómez, José M.M. Montiel and Juan D. Tardós, University of Zaragoza. ORB-SLAM2 Copyright (C) 2014-2016 Raúl Mur-Artal, José M.M. Montiel and Juan D. Tardós, University of Zaragoza. This program comes with ABSOLUTELY NO WARRANTY; This is free software, and you are welcome to redistribute it under certain conditions. See LICENSE.txt.

Input sensor was set to: Monocular Loading settings from ./Examples/Monocular/EuRoC.yaml Camera1.k3 optional parameter does not exist... -Loaded camera 1 Camera.newHeight optional parameter does not exist... Camera.newWidth optional parameter does not exist... -Loaded image info -Loaded ORB settings Viewer.imageViewScale optional parameter does not exist... -Loaded viewer settings System.LoadAtlasFromFile optional parameter does not exist... System.SaveAtlasToFile optional parameter does not exist... -Loaded Atlas settings System.thFarPoints optional parameter does not exist... -Loaded misc parameters

SLAM settings: -Camera 1 parameters (Pinhole): [ 458.65399169921875 457.29598999023438 367.21499633789062 248.375 ] -Camera 1 distortion parameters: [ -0.28340810537338257 0.073959067463874817 0.00019359000725671649 1.7618711353861727e-05 ] -Original image size: [ 752 , 480 ] -Current image size: [ 752 , 480 ] -Sequence FPS: 20 -Scale factor of image pyramid: 1.2000000476837158 -Levels of image pyramid: 4 -Features per image: 675 -Detector threshold: 0.0099999997764825821 -Load model path: /home/yu/ubuntu20/tf_docker/hfnet_tf/

2023-07-12 08:42:11.292391: I tensorflow/cc/saved_model/reader.cc:43] Reading SavedModel from: /home/yu/ubuntu20/tf_docker/hfnet_tf/ 2023-07-12 08:42:11.296498: I tensorflow/cc/saved_model/reader.cc:81] Reading meta graph with tags { serve } 2023-07-12 08:42:11.296517: I tensorflow/cc/saved_model/reader.cc:122] Reading SavedModel debug info (if present) from: /home/yu/ubuntu20/tf_docker/hfnet_tf/ 2023-07-12 08:42:11.296584: I tensorflow/core/platform/cpu_feature_guard.cc:193] This TensorFlow binary is optimized with oneAPI Deep Neural Network Library (oneDNN) to use the following CPU instructions in performance-critical operations: AVX_VNNI To enable them in other operations, rebuild TensorFlow with the appropriate compiler flags. 2023-07-12 08:42:11.651211: I tensorflow/core/common_runtime/gpu/gpu_device.cc:1532] Created device /job:localhost/replica:0/task:0/device:GPU:0 with 3142 MB memory: -> device: 0, name: NVIDIA GeForce RTX 3060 Laptop GPU, pci bus id: 0000:01:00.0, compute capability: 8.6 2023-07-12 08:42:11.671593: I tensorflow/compiler/mlir/mlir_graph_optimization_pass.cc:354] MLIR V1 optimization pass is not enabled 2023-07-12 08:42:11.680870: I tensorflow/cc/saved_model/loader.cc:228] Restoring SavedModel bundle. 2023-07-12 08:42:11.857430: I tensorflow/cc/saved_model/loader.cc:301] SavedModel load for tags { serve }; Status: success: OK. Took 565036 microseconds. 2023-07-12 08:42:12.509429: I tensorflow/stream_executor/cuda/cuda_dnn.cc:384] Loaded cuDNN version 8401 段错误 (核心已转储)

这个问题主要是什么原因呢? 还有:tensorRT这种编译方式如何安装环境?我始终没有找到可靠的安装tensorRT C++API的方式