myalos / monodepth2nyu

4 stars 0 forks source link

NYUv2 dataset #1

Closed QZZZZZYF closed 1 year ago

QZZZZZYF commented 1 year ago

Hello, I would like to inquire about the format of the NYUv2 dataset in this code.

myalos commented 1 year ago

The dataset i used is the raw dataset of NYUv2 and the format of the pictures in this dataset is ppm, pgm

QZZZZZYF commented 1 year ago

I meet a problem when I train:

KeyError: ('color', -1, -1) Training model named: mdp Models and tensorboard events files are saved to: log Training is using: cuda Using split: nyu There are 21483 training items and 654 validation items

Training Traceback (most recent call last): File "/media/enb/d246805e-89c3-40bf-95da-9f0d81ea7b05/home/enb/ZYF/monodepth2nyu-master/train.py", line 18, in trainer.train() File "/media/enb/d246805e-89c3-40bf-95da-9f0d81ea7b05/home/enb/ZYF/monodepth2nyu-master/trainer.py", line 158, in train self.run_epoch() File "/media/enb/d246805e-89c3-40bf-95da-9f0d81ea7b05/home/enb/ZYF/monodepth2nyu-master/trainer.py", line 169, in run_epoch for batch_idx, inputs in enumerate(self.train_loader): File "/home/enb/Software/anaconda3/envs/cuda11.8/lib/python3.8/site-packages/torch/utils/data/dataloader.py", line 435, in next data = self._next_data() File "/home/enb/Software/anaconda3/envs/cuda11.8/lib/python3.8/site-packages/torch/utils/data/dataloader.py", line 1085, in _next_data return self._process_data(data) File "/home/enb/Software/anaconda3/envs/cuda11.8/lib/python3.8/site-packages/torch/utils/data/dataloader.py", line 1111, in _process_data data.reraise() File "/home/enb/Software/anaconda3/envs/cuda11.8/lib/python3.8/site-packages/torch/_utils.py", line 428, in reraise raise self.exc_type(msg) KeyError: Caught KeyError in DataLoader worker process 0. Original Traceback (most recent call last): File "/home/enb/Software/anaconda3/envs/cuda11.8/lib/python3.8/site-packages/torch/utils/data/_utils/worker.py", line 198, in _worker_loop data = fetcher.fetch(index) File "/home/enb/Software/anaconda3/envs/cuda11.8/lib/python3.8/site-packages/torch/utils/data/_utils/fetch.py", line 44, in fetch data = [self.dataset[idx] for idx in possibly_batched_index] File "/home/enb/Software/anaconda3/envs/cuda11.8/lib/python3.8/site-packages/torch/utils/data/_utils/fetch.py", line 44, in data = [self.dataset[idx] for idx in possibly_batched_index] File "/media/enb/d246805e-89c3-40bf-95da-9f0d81ea7b05/home/enb/ZYF/monodepth2nyu-master/datasets/nyu_dataset.py", line 199, in getitem del inputs[("color", i, -1)] KeyError: ('color', -1, -1)

myalos commented 1 year ago

Sorry for late reply. Did you solve the problem?

QZZZZZYF commented 1 year ago

This problem has not been resolved yet, and I am still troubled by this error report.

myalos commented 1 year ago

it seems that the image data has not been read into the inputs

for ind, i in enumerate([0, -4, -3, -2, -1, 1, 2, 3, 4]):
    if not i in set(self.frame_idxs):
        continue

    inputs[("color", i, -1)] = self.get_color(line[ind], do_flip)
    if self.debug:
        inputs[("color", i, -1)] = self.to_tensor(self.get_color(line[ind], do_flip))

i suggest that you could debug from this place to see why the data is not loaded.

myalos commented 1 year ago

There should be no bugs in this code. I am curious if your problem is solved. If you solve the problem please let me know.

QZZZZZYF commented 1 year ago

Sorry for taking so long to reply, I haven't resolved the issue yet.

myalos commented 1 year ago

I cannot check this repo(sorry for that), since my experimental computer is at home, and I am working in another city. I will go home around August 26th, at that time I will check this code again and give more details about this code.

myalos commented 1 year ago

I update the repo today and fix the bug. It should be my fault, sorry. I test the code and the code run successfully. Please let me know if you run successfully to reproduce the result or if there is any problem, thank you.

QZZZZZYF commented 1 year ago

Thank you. The code has been successfully run. I see that the ‘nyu_test/00001.h5’ in ‘splits/nyu_test’ is an H5 file. Could you share it with nyu_test file?

myalos commented 1 year ago

This was downloaded a long time ago, it should be in the evaluation section of this website https://github.com/svip-lab/Indoor-SfMLearner