Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Segmentation fault (Address not mapped to object [0x70]) When "rosrun loop_fusion loop_fusion_node" #11

Closed
chenjack9017 opened this issue Oct 16, 2024 · 15 comments

Comments

@chenjack9017
Copy link

Your paper is excellent! But now I am facing some difficult problems to deal with

1、Roscore
2 roslaunch vins vins_rviz.launch
3 rosrun vins vins_node /home/cjw/ws1/src/D_VINS-main/config/euroc/euroc_mono_imu_config.yaml 4 rosrun loop_fusion loop_fusion_node /home/cjw/ws1/src/D_VINS-main/config/euroc/euroc_mono_imu_config.yaml
5 rosbag play ~/SLAM/MH_04_difficult.bag

After returning the rosbag, the fourth window runs normally, but waiting for a while will result in the following error:
(base) cjw@c:~/ws1$ rosrun loop_fusion loop_fusion_node /home/cjw/ws1/src/D_VINS-main/config/euroc/euroc_mono_imu_config.yaml config_file: /home/cjw/ws1/src/D_VINS-main/config/euroc/euroc_mono_imu_config.yaml vocabulary_file/home/cjw/ws1/src/D_VINS-main/loop_fusion/../support_files/brief_k10L6.bin loop start load vocabulary BRIEF_PATTERN_FILE/home/cjw/ws1/src/D_VINS-main/loop_fusion/../support_files/brief_pattern.yml cam calib path: /home/cjw/ws1/src/D_VINS-main/config/euroc/cam0_mei.yaml VIO input, perfrom 4 DoF (x, y, z, yaw) pose graph optimization no previous pose graph Stack trace (most recent call last) in thread 113307: #6 Object "[0xffffffffffffffff]", at 0xffffffffffffffff, in #5 Object "/lib/x86_64-linux-gnu/libc.so.6", at 0x7f19c79f9352, in clone #4 Object "/lib/x86_64-linux-gnu/libpthread.so.0", at 0x7f19cd07c608, in #3 Object "/lib/x86_64-linux-gnu/libstdc++.so.6", at 0x7f19c7d0edf3, in #2 Object "/home/cjw/ws1/devel/lib/loop_fusion/loop_fusion_node", at 0x55625289f97f, in process() #1 Object "/home/cjw/ws1/devel/lib/loop_fusion/loop_fusion_node", at 0x5562528deade, in KeyFrame::KeyFrame(double, int, Eigen::Matrix<double, 3, 1, 0, 3, 1>&, Eigen::Matrix<double, 3, 3, 0, 3, 3>&, cv::Mat&, std::vector<cv::Point3_<float>, std::allocator<cv::Point3_<float> > >&, std::vector<cv::Point_<float>, std::allocator<cv::Point_<float> > >&, std::vector<cv::Point_<float>, std::allocator<cv::Point_<float> > >&, std::vector<double, std::allocator<double> >&, int) #0 Object "/home/cjw/ws1/devel/lib/loop_fusion/loop_fusion_node", at 0x5562528dc63a, in KeyFrame::computeWindowSuperpoint() Segmentation fault (Address not mapped to object [0x70]) 段错误 (核心已转储)
Have you encountered a similar problem before?

@kajo-kurisu
Copy link
Owner

use euroc_stereo_imu config instead or follow it to revise your config

@chenjack9017
Copy link
Author

Thank you very much for your reply!
The environment I am currently using is Ubuntu 20.04 and Ros1, and all other environments have been designed according to your requirements. However, the issue you mentioned in issue 3 has arisen
[2024-10-21 17:30:10][fatal][trt_tensor.cpp:359]:Assert failed, ndims == shape_.size()
Then I followed your instructions to view the dimensions and printed the values for each dimension:
`cout << "Binding Name: " << bindingName << endl;

        cout << "Dimensions: ";
        for (int j = 0; j < dims.nbDims; ++j) {
        cout << dims.d[j] << " "; 
         }
        cout << endl;`

The output is:
cjw@c:~$ rosrun loop_fusion loop_fusion_node /home/cjw/dvins/src/D_VINS/config/euroc/euroc_mono_imu_config.yaml
Binding Name: img
Binding Name: des
Binding Name: kpts0
Binding Name: kpts1
Binding Name: desc0
Binding Name: desc1
Binding Name: mscores0
Binding Name: mscores1
[2024-10-21 17:30:10][fatal][trt_tensor.cpp:359]:Assert failed, ndims == shape_.size()

I am confident that the config was downloaded according to your file and the v0.1.3 version of superpoint_512 and superpoint_lightglue as per your request.
I'm really not sure which direction to look for the mistake from now. Can you give me some guidance?

@chenjack9017
Copy link
Author

I'm very sorry, the code in trt_inner is:
` cout << "Binding Name: " << bindingName << endl;

        cout << "Dimensions: ";
        for (int j = 0; j < dims.nbDims; ++j) {
        cout << dims.d[j] << " "; 
         }
        cout << endl;`

@chenjack9017
Copy link
Author

and this is
cjw@c:~$ rosrun loop_fusion loop_fusion_node /home/cjw/dvins/src/D_VINS/config/euroc/euroc_stereo_imu_config.yaml Binding Name: img Dimensions: 1 3 320 320 Binding Name: des Dimensions: 1 512 Binding Name: kpts0 Dimensions: 1 -1 2 Binding Name: kpts1 Dimensions: 1 -1 2 Binding Name: desc0 Dimensions: 1 -1 256 Binding Name: desc1 Dimensions: 1 -1 256 Binding Name: mscores0 Dimensions: 1 -1 [2024-10-20 23:29:25][fatal][trt_tensor.cpp:359]:Assert failed, ndims == shape_.size()

@kajo-kurisu
Copy link
Owner

Make sure you really follow the steps I asked you to do, and check that your model was imported correctly at the beginning of deep_net.h

@chenjack9017
Copy link
Author

chenjack9017 commented Oct 22, 2024 via email

@chenjack9017
Copy link
Author

Make sure you really follow the steps I asked you to do, and check that your model was imported correctly at the beginning of deep_net.h

师兄您好,我现在貌似查到了大概是什么地方不对,但是不太确定。
您在trt_infer.cpp文件中要求if( !strcmp(bindingName,"matches0") || !strcmp(bindingName,"mscores0") || !strcmp(bindingName,"scores_r") )他们这几个输出的维度的第0维为动态的,但是我在检查了您在issue3中提出直接下载他们v0.1.3版本中的那两个onnx文件,其中的superpoint_lightglue.onnx转换成engine之后,我发现他们的第1维就不是您所要求的-1了,而是变成了1,其他的文件的数据貌似都是符合您在文件中所说的要求;

师兄您知道怎么解决吗?万分感谢!

@kajo-kurisu
Copy link
Owner

image
onnx的维度示意,检查一下你是不是自己导出错误了。。。

@kajo-kurisu
Copy link
Owner

而且你的问题是出自 computewindowsuperpoint,多半是你的sp_re没弄对

@chenjack9017
Copy link
Author

image onnx的维度示意,检查一下你是不是自己导出错误了。。。

师兄,非常抱歉,这个onnx是直接下载的他们v0.1.3版本的superpoint_lightglue.onnx吗?我下载的跟这个不一样呜呜呜
438BD88DEC82957EC69CC13165BA6803

@chenjack9017
Copy link
Author

而且你的问题是出自 computewindowsuperpoint,多半是你的sp_re没弄对

QQ20241023-151707
师兄,这个是sp_re的onnx信息

@chenjack9017
Copy link
Author

@kajo-kurisu 感谢师兄,我现在已经跑通了euroc_stereo_imu_config.yaml的工作,显示的非常好
daafdcd8-9568-468a-b90f-a7c0bfe48845
但是我在运行单目的时候还是会显示错误(虽然我可以不用单目,但是就是想求知一下,感谢您)
error
sp_re也是在pytorch1.13+cu11.7的环境生成的onnx,外加和您要求的转换引擎指令相同。

ps:您之前说的关于superpoint_lightglue.onnx的文件,从v0.1.3版本的release直接下载的和您要求的输出不一致,但是我后面无意发现他们在v2.0当中所使用的输出代码就只有那两个,因此我是在pytorch2.1+cu121的环境下,使用他们的代码进行了onnx的导出。随后再次使用cu11.7进行的转换engine。最后的的结果就是双目imu运行的第一个图所示,但是单目如图2所示依旧是失败了。

不知道有没有哪里不太对的地方,如果有的话非常感谢您的帮助,让我受益匪浅!
如果没有的话更感谢您对我的回复与指导,您的工作非常好!祝您学业进步!再次感谢!

@kajo-kurisu
Copy link
Owner

单双目按理说,只要你的config跟双目中的配置格式一样的话,是不影响模型工作的,这里报错是因为sp_re推理上出了问题,你可以检查一下单双目下的sp_re函数的输入区别,还有换数据集的时候width_adj ,height_adj要相应的改变。最后,vins下有euroc_mono 的 config,看看你是否用错了

@chenjack9017

This comment was marked as off-topic.

@kajo-kurisu
Copy link
Owner

我使用的是github 上一个 kaist2bag 的转换工具,只使用了图像和imu数据,运行时订阅的是imu_raw 的数据。
关于误差比较大的问题,之前做测试的时候大致检查过,可能是由于过度优化,导致一些车行驶的时候本来就是弯曲的路线给优化直了,最终的误差较大,但是基本上多次运行的平均误差与论文内展示的数据一致。另外由于运行环境的不同,你可以试试调节PNP的参数和回环阈值来选出比较适合你的参数

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants