chrischoy/FCGF

Problem running demo.py

tpatten opened this issue · 4 comments

Running demo.py script returns this error

Extension = ply
Traceback (most recent call last):
  File "demo.py", line 73, in <module>
    demo(config)
  File "demo.py", line 41, in demo
    skip_check=True)
  File "/home/tpatten/Code/FCGF/util/misc.py", line 82, in extract_features
    coords = coords[inds]
IndexError: shape mismatch: indexing arrays could not be broadcast together with shapes (20685,3) (20685,)```

Similar error when running the training script for 3DMatch

Traceback (most recent call last):
  File "train.py", line 84, in <module>
    main(config)
  File "train.py", line 63, in main
    trainer.train()
  File "/home/tpatten/Code/FCGF/lib/trainer.py", line 124, in train
    val_dict = self._valid_epoch()
  File "/home/tpatten/Code/FCGF/lib/trainer.py", line 314, in _valid_epoch
    input_dict = data_loader_iter.next()
  File "/usr/local/lib/python3.7/dist-packages/torch/utils/data/dataloader.py", line 363, in __next__
    data = self._next_data()
  File "/usr/local/lib/python3.7/dist-packages/torch/utils/data/dataloader.py", line 989, in _next_data
    return self._process_data(data)
  File "/usr/local/lib/python3.7/dist-packages/torch/utils/data/dataloader.py", line 1014, in _process_data
    data.reraise()
  File "/usr/local/lib/python3.7/dist-packages/torch/_utils.py", line 395, in reraise
    raise self.exc_type(msg)
IndexError: Caught IndexError in DataLoader worker process 0.
Original Traceback (most recent call last):
  File "/usr/local/lib/python3.7/dist-packages/torch/utils/data/_utils/worker.py", line 185, in _worker_loop
    data = fetcher.fetch(index)
  File "/usr/local/lib/python3.7/dist-packages/torch/utils/data/_utils/fetch.py", line 44, in fetch
    data = [self.dataset[idx] for idx in possibly_batched_index]
  File "/usr/local/lib/python3.7/dist-packages/torch/utils/data/_utils/fetch.py", line 44, in <listcomp>
    data = [self.dataset[idx] for idx in possibly_batched_index]
  File "/home/tpatten/Code/FCGF/lib/data_loaders.py", line 252, in __getitem__
    pcd0.colors = o3d.utility.Vector3dVector(color0[sel0])
IndexError: shape mismatch: indexing arrays could not be broadcast together with shapes (22361,3) (22361,)

I changed every 'inds' to 'inds[1]' and it seems solve the problem

Similar error when running the training script for 3DMatch

Traceback (most recent call last):
  File "train.py", line 84, in <module>
    main(config)
  File "train.py", line 63, in main
    trainer.train()
  File "/home/tpatten/Code/FCGF/lib/trainer.py", line 124, in train
    val_dict = self._valid_epoch()
  File "/home/tpatten/Code/FCGF/lib/trainer.py", line 314, in _valid_epoch
    input_dict = data_loader_iter.next()
  File "/usr/local/lib/python3.7/dist-packages/torch/utils/data/dataloader.py", line 363, in __next__
    data = self._next_data()
  File "/usr/local/lib/python3.7/dist-packages/torch/utils/data/dataloader.py", line 989, in _next_data
    return self._process_data(data)
  File "/usr/local/lib/python3.7/dist-packages/torch/utils/data/dataloader.py", line 1014, in _process_data
    data.reraise()
  File "/usr/local/lib/python3.7/dist-packages/torch/_utils.py", line 395, in reraise
    raise self.exc_type(msg)
IndexError: Caught IndexError in DataLoader worker process 0.
Original Traceback (most recent call last):
  File "/usr/local/lib/python3.7/dist-packages/torch/utils/data/_utils/worker.py", line 185, in _worker_loop
    data = fetcher.fetch(index)
  File "/usr/local/lib/python3.7/dist-packages/torch/utils/data/_utils/fetch.py", line 44, in fetch
    data = [self.dataset[idx] for idx in possibly_batched_index]
  File "/usr/local/lib/python3.7/dist-packages/torch/utils/data/_utils/fetch.py", line 44, in <listcomp>
    data = [self.dataset[idx] for idx in possibly_batched_index]
  File "/home/tpatten/Code/FCGF/lib/data_loaders.py", line 252, in __getitem__
    pcd0.colors = o3d.utility.Vector3dVector(color0[sel0])
IndexError: shape mismatch: indexing arrays could not be broadcast together with shapes (22361,3) (22361,)

I also encountered the same problem. Have you solved this problem?

Fixed on the cc5b700