graspnet / graspnetAPI

Toolbox for our GraspNet-1Billion dataset.
https://graspnet.net/index.html
203 stars 52 forks source link

使用pickle.load()加载dex_models时报错 #46

Closed upc-ghy closed 1 year ago

upc-ghy commented 1 year ago

您好,非常感谢您的数据集和graspnetAPI,能向您们请教一个问题吗。我在执行测试模型,加载dex_models时遇到了以下错误,我没有找到修改bug的地方,您知道这是什么引起的吗,是因为dex_models数据集中 'ColorVisuals'对象没有'crc'属性吗,我该如何修改呢。

Traceback (most recent call last):
File "test.py", line 118, in <module>
    evaluate()
File "test.py", line 112, in evaluate
    res, ap = ge.eval_all(cfgs.dump_dir, proc=cfgs.num_workers)
File "graspnetAPI/graspnet_eval.py", line 120, in eval_scene
    model_list, dexmodel_list, _ = self.get_scene_models(scene_id, ann_id=0)
File "graspnetAPI/graspnet_eval.py", line 50, in get_scene_models
    dexmodel = pickle.load(f)
AttributeError: 'ColorVisuals' object has no attribute 'crc'

您们的部分源码:

for obj_idx in obj_list:
      model = o3d.io.read_point_cloud(os.path.join(model_dir, '%03d' % obj_idx, 'nontextured.ply'))
      dex_cache_path = os.path.join(self.root, 'dex_models', '%03d.pkl' % obj_idx)
      if os.path.exists(dex_cache_path):
          with open(dex_cache_path, 'rb') as f:
              dexmodel = pickle.load(f)   # 这句话报了错:AttributeError: 'ColorVisuals' object has no attribute 'crc'
      else:
          dexmodel = load_dexnet_model(os.path.join(model_dir, '%03d' % obj_idx, 'textured'))
      points = np.array(model.points)
      model_list.append(points)
      dexmodel_list.append(dexmodel)
chenxi-wang commented 1 year ago

可以参考这里:https://github.com/graspnet/graspnet-baseline/issues/47

upc-ghy commented 1 year ago

@chenxi-wang 非常感谢,解决啦!