Ubuntu 18.04 运行DynaSLAM的记录

Ubuntu 18.04 运行DynaSLAM的记录

DynaSLAM效果图

下载代码

git clone https://github.com/BertaBescos/DynaSLAM.git

配置环境

遇到的问题

问题1:遇到GTK版本不兼容问题

报错:
xh@xh:~/Desktop/dynamic-slam/DynaSLAM$ ./Examples/RGB-D/rgbd_tum Vocabulary/ORBvoc.txt Examples/RGB-D/TUM3.yaml ../../../Documents/slam/tum-dataset/rgbd_dataset_freiburg3_walking_xyz Examples/RGB-D/associations/fr3_walking_xyz.txt src/python/mask_rcnn_coco.h5 no_save
nImages: 827
Loading Mask R-CNN. This could take a while...
Importing Mask R-CNN Settings...

(modpython:19291): Gtk-ERROR **: 23:11:46.813: GTK+ 2.x symbols detected. Using GTK+ 2.x and GTK+ 3 in the same process is not supported
Trace/breakpoint trap (core dumped)
sudo gedit /etc/matplotlibrc

修改打开的文件中的内容(我的文件打开默认下面的是GTK3AGG,由于我报错提示的是检测到GTK+ 2.x,所以现在吧GTK改为2就可以):

# If you omit this parameter, it will always default to "Agg", which is a
# non-interactive backend.
#default is-backend      : TkAgg
backend      : GTKAgg

修改后在运行程序。又报错。但是错误不同,说明前一个GTK问题已经解决。

xh@xh:~/Desktop/dynamic-slam/DynaSLAM$ ./Examples/RGB-D/rgbd_tum Vocabulary/ORBvoc.txt Examples/RGB-D/TUM3.yaml ../../../Documents/slam/tum-dataset/rgbd_dataset_freiburg3_walking_xyz Examples/RGB-D/associations/fr3_walking_xyz.txt src/python/mask_rcnn_coco.h5 output/
nImages: 827
Loading Mask R-CNN. This could take a while...
Importing Mask R-CNN Settings...
    py_path: ./src/python/
    module_name: MaskRCNN
    class_name: Mask
    get_dyn_seg: GetDynSeg
rgbd_tum: /home/xh/Desktop/dynamic-slam/DynaSLAM/src/MaskNet.cc:45: DynaSLAM::SegmentDynObject::SegmentDynObject(): Assertion `this->py_module != NULL' failed.
Aborted (core dumped)

错误的意思是运行程序后得到的py_module为空。现在解决这个问题:
方法一:github官方issue
这一步对应的代码是

this->cvt = new NDArrayConverter();
this->py_module = PyImport_ImportModule(this->module_name.c_str());

然后官方issue中建议运行src/python/Check.py文件检查一下python对应的环境是否配置合适。
结果是matplotlib的版本有问题,运行Check.py的结果是matplotlib有一个包不存在,是因为GTK的问题,需要降matplotlib的版本,针对于此,我也降低了tensorflowkeras的版本。与官方保持一致。

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值