ChiWeiHsiao / DeepVO-pytorch

PyTorch Implementation of DeepVO

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

array question

yxh1993 opened this issue · comments

Hi,guy!I have this problem:
Traceback (most recent call last):
File "/home/yxh/src/DeepVO-pytorch-master/main.py", line 102, in
for _, t_x, t_y in train_dl:
File "/home/yxh/anaconda3/lib/python3.6/site-packages/torch/utils/data/dataloader.py", line 637, in next
return self._process_next_batch(batch)
File "/home/yxh/anaconda3/lib/python3.6/site-packages/torch/utils/data/dataloader.py", line 658, in _process_next_batch
raise batch.exc_type(batch.exc_msg)
ValueError: Traceback (most recent call last):
File "/home/yxh/anaconda3/lib/python3.6/site-packages/torch/utils/data/dataloader.py", line 138, in _worker_loop
samples = collate_fn([dataset[i] for i in batch_indices])
File "/home/yxh/anaconda3/lib/python3.6/site-packages/torch/utils/data/dataloader.py", line 138, in
samples = collate_fn([dataset[i] for i in batch_indices])
File "/home/yxh/src/DeepVO-pytorch-master/data_helper.py", line 201, in getitem
groundtruth_rotation = raw_groundtruth[1][0].reshape((3, 3)).T # opposite rotation of the first frame
ValueError: cannot reshape array of size 0 into shape (3,3)

what should i do?Thanks

@yxh1993 try to clean up 'datainfo' folder and run preprocess.py and main.py again.

I deleted the files and downloaded them again into the same folder and ran the 2 python codes. But the error still persists.
raw_groundtruth[0] contains multiple pose values but raw_groundtruth[1] is indeed empty.

  1. Could you kindly mention what exactly to do for cleaning up?
  2. Should it be raw_groundtruth[0][0] instead of [1][0]?
  3. What does the raw_groundtruth represent?
    Any help would be greatly appreciated.
    Cheers.

Oh got the meaning of cleaning up. I removed the files and let the code generate it this time. That error went away but the length of train_dl is now zero. Hence it is throwing a division by zero error.
There are no samples in the training and validation datasets. Will just check the ImageSequenceDataset and SortedRandomBatchSampler code.