- 使用使用TUM的associate.py脚本(我自己为了区分原版的,将自己使用的相机版本名称改成associate_d455.py,下面的其他文件同理)报错AttributeError: ‘dict_keys’ object has no attribute ‘remove’。
2. 错误分析:python版本不对。当前使用版本是3,associate_d455.py的语言版本是2
2.5 深层次分析:
在Python 3中,dict.keys()返回没有remove方法的dict_keys对象。与Python 2不同,Python 2 dict.keys()返回列表对象。
In Python 3, dict.keys() returns a dict_keys object (a view of the dictionary) which does not have remove method; unlike Python 2, where dict.keys() returns a list object.
原文链接:https://blog.csdn.net/weixin_44694952/article/details/104429905
3. 使用命令(懒得修改源码,直接大力出奇迹使用python2的命令):
python2 associate_d455.py rgbdata.txt depthdata.txt > associate_d455.txt