Ubuntu 18.04 运行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
的版本,针对于此,我也降低了tensorflow
和keras
的版本。与官方保持一致。